s3-printing: fix bug 9123 lprng job tracking errors
authorDavid Disseldorp <ddiss@samba.org>
Tue, 28 Aug 2012 16:58:24 +0000 (18:58 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 30 Aug 2012 06:26:35 +0000 (08:26 +0200)
The lprng printing back-end is truncating the print job filename in the
lpq output, which means that Samba is not able to determine the back-end
job ID for a newly submitted print job.
Remove the unneeded spoolss job ID from the print job file name to
ensure the job filename is not truncated. Also log these warnings at a
higher log level.

source3/printing/print_generic.c
source3/printing/printing.c

index aac3892dcd3e1e2b4ca9044755207e4852313ab1..7a7cd3bc4bd40f9fc0dc351e8eb197e6598e4e1f 100644 (file)
@@ -288,7 +288,7 @@ static int generic_job_submit(int snum, struct printjob *pjob,
                ret = 0;
        }
        if (pjob->sysjob == -1) {
-               DEBUG(0, ("failed to get sysjob for job %u (%s), tracking as "
+               DEBUG(2, ("failed to get sysjob for job %u (%s), tracking as "
                          "Unix job\n", pjob->jobid, jobname));
        }
 
index aa5b41d57cd367f13fb28fd946de0626d5f64d9a..ba739182f949b8ba5ede5a996d0cbc8a10e41763 100644 (file)
@@ -2843,8 +2843,7 @@ static WERROR print_job_spool_file(int snum, uint32_t jobid,
        }
 
        slprintf(pjob->filename, sizeof(pjob->filename)-1,
-                "%s/%s%.8u.XXXXXX", lp_pathname(snum),
-                PRINT_SPOOL_PREFIX, (unsigned int)jobid);
+                "%s/%sXXXXXX", lp_pathname(snum), PRINT_SPOOL_PREFIX);
        pjob->fd = mkstemp(pjob->filename);
 
        if (pjob->fd == -1) {