diff options
author | Gerald Carter <jerry@samba.org> | 2004-01-14 20:56:26 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2004-01-14 20:56:26 +0000 |
commit | bb104f31d5a849d5a3a0865fa77824c90d5e927e (patch) | |
tree | 216fdfa60ab06f44513836091beffb45c395e377 /source3/printing | |
parent | e7615b5776604af23592ed26dc0aa3ae0076835e (diff) | |
download | samba-bb104f31d5a849d5a3a0865fa77824c90d5e927e.tar.gz samba-bb104f31d5a849d5a3a0865fa77824c90d5e927e.tar.bz2 samba-bb104f31d5a849d5a3a0865fa77824c90d5e927e.zip |
bug 770; correct fix this time; Make sure that we send the SMBjobid for unix jobs back to the client. Allows windows client to remove print jobs submitted from lpr
(This used to be commit 514561118860f982c458930c34763dac9ce0554e)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/printing.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index ae7291bfc7..1f0bb1e074 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -597,7 +597,7 @@ static void print_unix_job(int snum, print_queue_struct *q, uint32 jobid) { struct printjob pj, *old_pj; - if (jobid == (uint32)-1) + if (jobid == (uint32)-1) jobid = q->job + UNIX_JOB_START; /* Preserve the timestamp on an existing unix print job */ @@ -671,9 +671,11 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void DEBUG(10,("traverse_fn_delete: pjob %u deleted due to !smbjob\n", (unsigned int)jobid )); pjob_delete(ts->snum, jobid); - } else - ts->total_jobs++; - return 0; + return 0; + } + + /* need to continue the the bottom of the function to + save the correct attributes */ } /* maybe it hasn't been spooled yet */ @@ -690,10 +692,14 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void return 0; } - for (i=0;i<ts->qcount;i++) { - uint32 curr_jobid = print_parse_jobid(ts->queue[i].fs_file); - if (jobid == curr_jobid) - break; + /* this check only makes sense for jobs submitted from Windows clients */ + + if ( pjob.smbjob ) { + for (i=0;i<ts->qcount;i++) { + uint32 curr_jobid = print_parse_jobid(ts->queue[i].fs_file); + if (jobid == curr_jobid) + break; + } } /* The job isn't in the system queue - we have to assume it has @@ -720,7 +726,9 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void } /* Save the pjob attributes we will store. */ - ts->queue[i].job = jobid; + /* FIXME!!! This is the only place where queue->job + represents the SMB jobid --jerry */ + ts->queue[i].job = jobid; ts->queue[i].size = pjob.size; ts->queue[i].page_count = pjob.page_count; ts->queue[i].status = pjob.status; |