16362516 lpstat and lpq commands report bad value s11-update
authorSonam Gupta <sonam.x.gupta@oracle.com>
Mon, 13 May 2013 22:49:13 -0700
branchs11-update
changeset 2621 f16db03950b1
parent 2620 70885a8bb9bc
child 2622 d936fa6247d5
16362516 lpstat and lpq commands report bad value 16321334 lpstat -p always reports job id as '-0' 15731683 SUNBT7072114 cupsd: segfault in move_job+0x29d
components/cups/patches/22-16362516,16321334,15731683.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/cups/patches/22-16362516,16321334,15731683.patch	Mon May 13 22:49:13 2013 -0700
@@ -0,0 +1,26 @@
+--- scheduler/ipp.c	Thu Mar 28 22:47:57 2013
++++ scheduler/ipp.c	Tue Apr  9 00:31:58 2013
[email protected]@ -7424,8 +7424,12 @@
+       continue;
+     }
+ 
+-    if (username[0] && strcasecmp(username, job->username))
+-      continue;
++    /*
++     * If no username is given, then it might be set to 'anonymous'.
++     * In this case we don't compare with job->username.
++     */
++    if (username[0] && strcasecmp(username, "anonymous") && strcasecmp(username, job->username))
++	continue;
+ 
+     if (count > 0)
+       ippAddSeparator(con->response);
[email protected]@ -8780,7 +8784,7 @@
+    * Validate that the label associated with the job is acceptable for
+    * printing on the printer.
+    */
+-  if (cupsdInPrinterLabelRange(job->slabel, dprinter) == 0)
++  if (job && (cupsdInPrinterLabelRange(job->slabel, dprinter) == 0))
+   {
+     send_ipp_status(con, IPP_NOT_AUTHORIZED, _("label violation."));
+     return;