summaryrefslogtreecommitdiff
path: root/source3/printing/printing.c
diff options
context:
space:
mode:
authorDavid O'Neill <dmo@samba.org>2001-01-24 16:46:08 +0000
committerDavid O'Neill <dmo@samba.org>2001-01-24 16:46:08 +0000
commite31bf053633440bc3ceceb9208bb857fe94237a0 (patch)
tree38814f0f87fd34cf6d0f93e06a10bddbcedcefaf /source3/printing/printing.c
parentb1be311add2bd56875f3ffb9fcde56f6289ade22 (diff)
downloadsamba-e31bf053633440bc3ceceb9208bb857fe94237a0.tar.gz
samba-e31bf053633440bc3ceceb9208bb857fe94237a0.tar.bz2
samba-e31bf053633440bc3ceceb9208bb857fe94237a0.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. (This used to be commit be61c98832d0a8969e608fd22da2035e454ec788)
Diffstat (limited to 'source3/printing/printing.c')
-rw-r--r--source3/printing/printing.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index e459721826..46d872df7c 100644
--- a/source3/printing/printing.c
+++ b/source3/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);
}
/****************************************************************************