diff options
author | Jeremy Allison <jra@samba.org> | 2003-02-19 01:43:33 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-02-19 01:43:33 +0000 |
commit | 647d65e08be07c87393b10cd95bf569978fc2a42 (patch) | |
tree | d542ddc848498d863bf95d19b8dee62f808432ae /source3 | |
parent | 5a5f4c62d5be792f7d6decb969e2ffb45dd6ff68 (diff) | |
download | samba-647d65e08be07c87393b10cd95bf569978fc2a42.tar.gz samba-647d65e08be07c87393b10cd95bf569978fc2a42.tar.bz2 samba-647d65e08be07c87393b10cd95bf569978fc2a42.zip |
Bit of a hack job to prevent smbprn.XXX jobs appearing in the queue if the
jobid is below the UNIX_JOB_START number.
Jeremy.
(This used to be commit 7ec1c8869d3df9af77ff95942beba34f56a06b73)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/printing/printing.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 3bf992ad69..c9612ab3a9 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -579,11 +579,13 @@ static uint32 print_parse_jobid(char *fname) List a unix job in the print database. ****************************************************************************/ -static void print_unix_job(int snum, print_queue_struct *q) +static void print_unix_job(int snum, print_queue_struct *q, uint32 jobid) { - uint32 jobid = q->job + UNIX_JOB_START; struct printjob pj, *old_pj; + if (jobid == (uint32)-1) + jobid = q->job + UNIX_JOB_START; + /* Preserve the timestamp on an existing unix print job */ old_pj = print_job_find(snum, jobid); @@ -597,11 +599,14 @@ static void print_unix_job(int snum, print_queue_struct *q) pj.status = q->status; pj.size = q->size; pj.spooled = True; - pj.smbjob = False; - fstrcpy(pj.filename, ""); - fstrcpy(pj.jobname, q->fs_file); - fstrcpy(pj.user, q->fs_user); - fstrcpy(pj.queuename, lp_const_servicename(snum)); + pj.smbjob = (old_pj != NULL ? True : False); + fstrcpy(pj.filename, old_pj ? old_pj->filename : ""); + if (jobid < UNIX_JOB_START) + fstrcpy(pj.jobname, old_pj ? old_pj->jobname : "Remote Downlevel Document"); + else + fstrcpy(pj.jobname, old_pj ? old_pj->jobname : q->fs_file); + fstrcpy(pj.user, old_pj ? old_pj->user : q->fs_user); + fstrcpy(pj.queuename, old_pj ? old_pj->queuename : lp_const_servicename(snum)); pjob_store(snum, jobid, &pj); } @@ -879,7 +884,7 @@ static void print_queue_update(int snum) if (jobid == (uint32)-1) { /* assume its a unix print job */ - print_unix_job(snum, &queue[i]); + print_unix_job(snum, &queue[i], jobid); continue; } @@ -889,7 +894,7 @@ static void print_queue_update(int snum) /* err, somethings wrong. Probably smbd was restarted with jobs in the queue. All we can do is treat them like unix jobs. Pity. */ - print_unix_job(snum, &queue[i]); + print_unix_job(snum, &queue[i], jobid); continue; } |