]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The IPP backend could get into an infinite loop for certain errors, causing a
authorMichael R Sweet <michaelrsweet@gmail.com>
Thu, 26 Jan 2017 21:27:05 +0000 (16:27 -0500)
committerMichael R Sweet <michaelrsweet@gmail.com>
Thu, 26 Jan 2017 21:27:05 +0000 (16:27 -0500)
hung queue (<rdar://problem/28008717>)

CHANGES.txt
backend/ipp.c

index 5dc93414e70f5dc9203486038ba904221061f521..5630ee88d7f19bd3960b23d76ab01b45ea293863 100644 (file)
@@ -3,6 +3,8 @@ CHANGES.txt - 2.2.3 - 2017-01-26
 
 CHANGES IN CUPS V2.2.3
 
 
 CHANGES IN CUPS V2.2.3
 
+       - The IPP backend could get into an infinite loop for certain errors,
+         causing a hung queue (<rdar://problem/28008717>)
        - Fixed some localization issues on macOS.
 
 
        - Fixed some localization issues on macOS.
 
 
index 6eefd144e7a54a19e5a98a6a8193a52e21075f55..685d4d9dff602b55332bfba57262b043ed8cdfc7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * IPP backend for CUPS.
  *
 /*
  * IPP backend for CUPS.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -1469,7 +1469,7 @@ main(int  argc,                           /* I - Number of command-line args */
 
   while (!job_canceled && validate_job)
   {
 
   while (!job_canceled && validate_job)
   {
-    request = new_request(IPP_VALIDATE_JOB, version, uri, argv[2],
+    request = new_request(IPP_OP_VALIDATE_JOB, version, uri, argv[2],
                           monitor.job_name, num_options, options, compression,
                          copies_sup ? copies : 1, document_format, pc, ppd,
                          media_col_sup, doc_handling_sup, print_color_mode_sup);
                           monitor.job_name, num_options, options, compression,
                          copies_sup ? copies : 1, document_format, pc, ppd,
                          media_col_sup, doc_handling_sup, print_color_mode_sup);
@@ -1533,6 +1533,8 @@ main(int  argc,                           /* I - Number of command-line args */
     else if (ipp_status < IPP_REDIRECTION_OTHER_SITE ||
              ipp_status == IPP_BAD_REQUEST)
       break;
     else if (ipp_status < IPP_REDIRECTION_OTHER_SITE ||
              ipp_status == IPP_BAD_REQUEST)
       break;
+    else if (job_auth == NULL && ipp_status > IPP_BAD_REQUEST)
+      goto cleanup;
   }
 
  /*
   }
 
  /*
@@ -2216,7 +2218,7 @@ main(int  argc,                           /* I - Number of command-line args */
     return (CUPS_BACKEND_HOLD);
   else if (ipp_status == IPP_INTERNAL_ERROR)
     return (CUPS_BACKEND_STOP);
     return (CUPS_BACKEND_HOLD);
   else if (ipp_status == IPP_INTERNAL_ERROR)
     return (CUPS_BACKEND_STOP);
-  else if (ipp_status == IPP_CONFLICT)
+  else if (ipp_status == IPP_CONFLICT || ipp_status == IPP_STATUS_ERROR_REQUEST_ENTITY || ipp_status == IPP_STATUS_ERROR_REQUEST_VALUE)
     return (CUPS_BACKEND_FAILED);
   else if (ipp_status == IPP_REQUEST_VALUE ||
           ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES ||
     return (CUPS_BACKEND_FAILED);
   else if (ipp_status == IPP_REQUEST_VALUE ||
           ipp_status == IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES ||