diff options
author | David O'Neill <dmo@samba.org> | 2001-01-24 16:46:08 +0000 |
---|---|---|
committer | David O'Neill <dmo@samba.org> | 2001-01-24 16:46:08 +0000 |
commit | be61c98832d0a8969e608fd22da2035e454ec788 (patch) | |
tree | c21415a12556c261a37ba78e9ee6a609998f9f2f | |
parent | 158430ba6a030061bc7d7b84126c6f7ea0041c91 (diff) | |
download | samba-be61c98832d0a8969e608fd22da2035e454ec788.tar.gz samba-be61c98832d0a8969e608fd22da2035e454ec788.tar.xz samba-be61c98832d0a8969e608fd22da2035e454ec788.zip |
Changes from APPLIANCE_HEAD:
source/printing/printing.c
- When deleting a job, remove the entry from the back-end database
if the delete succeeded. This stops a spurious permission denied
message appearing if the forced database update is within the lpq
cache timeout and doesn't actually delete the job from the
database.
-rw-r--r-- | source/printing/printing.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/source/printing/printing.c b/source/printing/printing.c index e4597218269..46d872df7c0 100644 --- a/source/printing/printing.c +++ b/source/printing/printing.c @@ -538,7 +538,7 @@ delete a print job - don't update queue static BOOL print_job_delete1(int jobid) { struct printjob *pjob = print_job_find(jobid); - int snum; + int snum, result = 0; if (!pjob) return False; @@ -553,17 +553,26 @@ static BOOL print_job_delete1(int jobid) } if (pjob->spooled && pjob->sysjob != -1) { - /* need to delete the spooled entry */ fstring jobstr; + + /* need to delete the spooled entry */ slprintf(jobstr, sizeof(jobstr), "%d", pjob->sysjob); - print_run_command(snum, - lp_lprmcommand(snum), NULL, - "%j", jobstr, - "%T", http_timestring(pjob->starttime), - NULL); + result = print_run_command( + snum, + lp_lprmcommand(snum), NULL, + "%j", jobstr, + "%T", http_timestring(pjob->starttime), + NULL); } - return True; + /* Delete the tdb entry if the delete suceeded or the job hasn't + been spooled. */ + + if (result == 0) { + tdb_delete(tdb, print_key(jobid)); + } + + return (result == 0); } /**************************************************************************** |