summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-02-19 01:38:12 +0000
committerJeremy Allison <jra@samba.org>2003-02-19 01:38:12 +0000
commite7b5d059c2af0ffb71e3d6b12a35a1dcd3295942 (patch)
treee47e0cb99f16910ddc826602fc556b8bf59b3cdd /source3/printing
parentadfefcdcb6e9d8ea0458a11b6f684a5cf231c3ba (diff)
downloadsamba-e7b5d059c2af0ffb71e3d6b12a35a1dcd3295942.tar.gz
samba-e7b5d059c2af0ffb71e3d6b12a35a1dcd3295942.tar.bz2
samba-e7b5d059c2af0ffb71e3d6b12a35a1dcd3295942.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 e8a9bf67cbe5b3e33f99e6793fe4ec445d6e8819)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c23
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;
}