diff options
author | David O'Neill <dmo@samba.org> | 2001-01-29 21:34:08 +0000 |
---|---|---|
committer | David O'Neill <dmo@samba.org> | 2001-01-29 21:34:08 +0000 |
commit | 025f7a092ad258ff774e3f5e53737f8210cc8af6 (patch) | |
tree | c39ec2f56a316f4a3fce5ca36e3dfdb2f033f151 /source/printing/printing.c | |
parent | f24aa0b51f06b8181b46bb1d2e73d91e5159fe1c (diff) | |
download | samba-025f7a092ad258ff774e3f5e53737f8210cc8af6.tar.gz samba-025f7a092ad258ff774e3f5e53737f8210cc8af6.tar.xz samba-025f7a092ad258ff774e3f5e53737f8210cc8af6.zip |
Changes from APPLIANCE_HEAD:
source/include/proto.h
- make proto
source/printing/nt_printing.c
source/rpc_server/srv_spoolss_nt.c
- Fix for the overwriting of printerdata entries when WinNT and
Win2k are modifying printer parameters on PCL printers. Turns out
that Win2k creates a printer with a NULL devmode entry and then
expects to set it on *OPEN* (yes this is insane). So we cannot
return a "default" devmode for a printer - and we must allow an
open to set it.
source/tdb/tdb.c
- Show freelist in an easier format. Show total free.
- When storing a new record, allocate memory for the key + data
before the tdb_allocate() as if the malloc fails a (sparse) hole
is left in the tdb.
source/tdb/tdbtool.c
- Show freelist in an easier format. Show total free.
source/tdb/Makefile
- cleaned up Makefile dependancies
source/smbd/lanman.c
- Fix for Win9x corrupting it's own parameter string.
source/printing/printfsp.c
source/printing/printing.c
source/rpc_server/srv_spoolss_nt.c
source/smbd/close.c
- Added normal close parameter into print_fsp_end() which treats an
abnormal close as error condition and deletes the spool file.
Diffstat (limited to 'source/printing/printing.c')
-rw-r--r-- | source/printing/printing.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/printing/printing.c b/source/printing/printing.c index 46d872df7c0..4dbb01e8390 100644 --- a/source/printing/printing.c +++ b/source/printing/printing.c @@ -950,9 +950,11 @@ int print_job_start(struct current_user *user, int snum, char *jobname) /**************************************************************************** Print a file - called on closing the file. This spools the job. + If normal close is false then we're tearing down the jobs - treat as an + error. ****************************************************************************/ -BOOL print_job_end(int jobid) +BOOL print_job_end(int jobid, BOOL normal_close) { struct printjob *pjob = print_job_find(jobid); int snum, ret; @@ -970,12 +972,17 @@ BOOL print_job_end(int jobid) snum = print_job_snum(jobid); - if (sys_fstat(pjob->fd, &sbuf) == 0) { + if (normal_close && (sys_fstat(pjob->fd, &sbuf) == 0)) { pjob->size = sbuf.st_size; close(pjob->fd); pjob->fd = -1; } else { - /* Couldn't stat the job file, so something has gone wrong. Cleanup */ + + /* + * Not a normal close or we couldn't stat the job file, + * so something has gone wrong. Cleanup. + */ + unlink(pjob->filename); tdb_delete(tdb, print_key(jobid)); return False; |