allow users to delete jobs with cups printing backend
authorGerald Carter <jerry@samba.org>
Tue, 25 Nov 2003 19:16:35 +0000 (19:16 +0000)
committerGerald Carter <jerry@samba.org>
Tue, 25 Nov 2003 19:16:35 +0000 (19:16 +0000)
The changes the name of the job passed off to cups
from "Test Page" to "smbprn.00000033 Test Page" so that
we can get the smb jobid back from lpq.  Working on bug
770.
(This used to be commit 5979f4d645e84fb22223e6cbf0043f2fa21acb2f)

source3/printing/print_cups.c
source3/printing/printing.c

index df621537984a54fbdd1dd8b6c8907ec5a8c242ff..f0096a17c2c40a42c082eb0288ac2039716b8e9f 100644 (file)
@@ -682,6 +682,7 @@ cups_job_submit(int snum, struct printjob *pjob)
        cups_lang_t     *language;      /* Default language */
        char            uri[HTTP_MAX_URI]; /* printer-uri attribute */
        char            *clientname;    /* hostname of client for job-originating-host attribute */
+       pstring         new_jobname;
 
        DEBUG(5,("cups_job_submit(%d, %p (%d))\n", snum, pjob, pjob->sysjob));
 
@@ -744,8 +745,11 @@ cups_job_submit(int snum, struct printjob *pjob)
                     "job-originating-host-name", NULL,
                      clientname);
 
+        pstr_sprintf(new_jobname,"%s%.8u %s", PRINT_SPOOL_PREFIX, 
+               (unsigned int)pjob->smbjob, pjob->jobname);
+
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
-                    pjob->jobname);
+                    new_jobname);
 
        /*
        * Do the request and get back a response...
index ad17213c2d65f0d0efeb83cb0d3cad1f446b03fd..32470fb22f102b4b799f63191a8ca9c47df716f3 100644 (file)
@@ -2063,6 +2063,8 @@ BOOL print_job_end(int snum, uint32 jobid, BOOL normal_close)
                return True;
        }
 
+       pjob->smbjob = jobid;
+
        ret = (*(current_printif->job_submit))(snum, pjob);
 
        if (ret)