allow users to delete jobs with cups printing backend
authorGerald Carter <jerry@samba.org>
Tue, 25 Nov 2003 19:17:20 +0000 (19:17 +0000)
committerGerald Carter <jerry@samba.org>
Tue, 25 Nov 2003 19:17:20 +0000 (19:17 +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 3a84daf24f80cf44605841c844a0ba516354420b)

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

index 291028b70cf10ca2d84ebb05f43d9a985d61cc50..77719ffc5284e07e6fa5812fe4825a646f55b78a 100644 (file)
@@ -681,6 +681,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));
 
@@ -743,8 +744,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 ef532473ba7f1c326e5e1b4352ce09188305077b..a4949f78e976e6d9da5434c64a54508ce62a545c 100644 (file)
@@ -2062,6 +2062,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)