summaryrefslogtreecommitdiff
path: root/source3/printing/printfsp.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-02-22 01:31:55 +0000
committerJeremy Allison <jra@samba.org>2001-02-22 01:31:55 +0000
commit201753ddc623a18f4ddd0d9a19391ea0471d4c49 (patch)
treef8e52b7b06464d16b93522a8bf9abbb6c343be17 /source3/printing/printfsp.c
parent5fa7c79c336584b9eb868abaae69f8fb5950c43b (diff)
downloadsamba-201753ddc623a18f4ddd0d9a19391ea0471d4c49.tar.gz
samba-201753ddc623a18f4ddd0d9a19391ea0471d4c49.tar.bz2
samba-201753ddc623a18f4ddd0d9a19391ea0471d4c49.zip
Fixed file descriptor leak in error processing of print jobs.
NT sends "delete on close" to cancel a print job copied from the command line. Deal with this. Merged JohnR's fixes for print job errors. Jeremy. (This used to be commit 2060d74e48d62c99a1689ee02ac435b71918ddf0)
Diffstat (limited to 'source3/printing/printfsp.c')
-rw-r--r--source3/printing/printfsp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c
index f6ab69fd93..c87fb9754f 100644
--- a/source3/printing/printfsp.c
+++ b/source3/printing/printfsp.c
@@ -84,6 +84,14 @@ print a file - called on closing the file
****************************************************************************/
void print_fsp_end(files_struct *fsp, BOOL normal_close)
{
+ if (fsp->share_mode == FILE_DELETE_ON_CLOSE) {
+ /*
+ * Truncate the job. print_job_end will take
+ * care of deleting it for us. JRA.
+ */
+ sys_ftruncate(fsp->fd, 0);
+ }
+
print_job_end(fsp->print_jobid, normal_close);
if (fsp->fsp_name) {