From b396904ff75555a61ab2eab21e9ad75c024352671b101fc0a81aa0e099707913 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Sat, 29 Jun 2013 10:49:02 +0000 Subject: [PATCH] Accepting request 181379 from home:StefanBruens:branches:Printing Fix for bnc#827418 OBS-URL: https://build.opensuse.org/request/show/181379 OBS-URL: https://build.opensuse.org/package/show/Printing/cups?expand=0&rev=262 --- cups.changes | 6 +++++ cups.spec | 5 ++++ str4190.patch | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 str4190.patch diff --git a/cups.changes b/cups.changes index bc3a4c5..ba1459b 100644 --- a/cups.changes +++ b/cups.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jun 28 20:16:52 UTC 2013 - stefan.bruens@rwth-aachen.de + +- Fix endless loop if IPP server does not accect job (bnc#827418) + see also https://www.cups.org/str.php?L4190 (STR#4190), + ------------------------------------------------------------------- Wed Jun 26 15:30:45 CEST 2013 - jsmeix@suse.de diff --git a/cups.spec b/cups.spec index 0e5b594..c9bafca 100644 --- a/cups.spec +++ b/cups.spec @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: cups BuildRequires: dbus-1-devel BuildRequires: fdupes @@ -174,6 +175,8 @@ Patch107: cups-provides-cupsd-service.patch # and yes upstream should do the same. Please also check: # http://lists.opensuse.org/opensuse-factory/2013-01/msg00578.html Patch108: cups-move-everything-to-run.patch +# STR #4190: Send-Document failure ignored (also applies to client-error-not-authorized) +Patch109: str4190.patch # Install into this non-root directory (required when norootforbuild is used): BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -316,6 +319,8 @@ printer drivers for CUPS. # Patch108 moves everything to /run %patch108 -p1 %endif +# Patch109: STR #4190 +%patch109 %build # Disable SILENT run of make so that make runs verbose as usual: diff --git a/str4190.patch b/str4190.patch new file mode 100644 index 0000000..46491b1 --- /dev/null +++ b/str4190.patch @@ -0,0 +1,72 @@ +Index: backend/ipp.c +=================================================================== +--- backend/ipp.c (revision 10611) ++++ backend/ipp.c (working copy) +@@ -1279,6 +1279,16 @@ + } + + /* ++ * If the printer only claims to support IPP/1.0, or if the user specifically ++ * included version=1.0 in the URI, then do not try to use Create-Job or ++ * Send-Document. This is another dreaded compatibility hack, but unfortunately ++ * there are enough broken printers out there that we need this for now... ++ */ ++ ++ if (version == 10) ++ create_job = send_document = 0; ++ ++ /* + * Start monitoring the printer in the background... + */ + +@@ -1494,10 +1504,9 @@ + goto cleanup; + } + } +- else if (ipp_status == IPP_ERROR_JOB_CANCELED) ++ else if (ipp_status == IPP_ERROR_JOB_CANCELED || ++ ipp_status == IPP_NOT_AUTHORIZED) + goto cleanup; +- else if (ipp_status == IPP_NOT_AUTHORIZED) +- continue; + else + { + /* +@@ -1678,14 +1687,35 @@ + ipp_status == IPP_NOT_POSSIBLE || + ipp_status == IPP_PRINTER_BUSY) + continue; +- else if (ipp_status == IPP_REQUEST_VALUE) ++ else if (ipp_status == IPP_REQUEST_VALUE || ++ ipp_status == IPP_ERROR_JOB_CANCELED || ++ ipp_status == IPP_NOT_AUTHORIZED) + { + /* +- * Print file is too large, abort this job... ++ * Print file is too large, job was canceled, or we need new ++ * authentication data... + */ + + goto cleanup; + } ++ else if (ipp_status == IPP_NOT_FOUND) ++ { ++ /* ++ * Printer does not actually implement support for Create-Job/ ++ * Send-Document, so log the conformance issue and stop the printer. ++ */ ++ ++ fputs("DEBUG: This printer claims to support Create-Job and " ++ "Send-Document, but those operations failed.\n", stderr); ++ fputs("DEBUG: Add '?version=1.0' to the device URI to use legacy " ++ "compatibility mode.\n", stderr); ++ update_reasons(NULL, "+cups-ipp-conformance-failure-report," ++ "cups-ipp-missing-send-document"); ++ ++ ipp_status = IPP_INTERNAL_ERROR; /* Force queue to stop */ ++ ++ goto cleanup; ++ } + else + copies_remaining --; +