rpms/cups/F-11 cups-str3435.patch,NONE,1.1 cups.spec,1.549,1.550

Tim Waugh twaugh at fedoraproject.org
Tue Dec 8 12:13:28 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/cups/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6668

Modified Files:
	cups.spec 
Added Files:
	cups-str3435.patch 
Log Message:
* Tue Dec  8 2009 Tim Waugh <twaugh at redhat.com> - 1:1.4.2-14
- Authenticated printing did not always work when printing directly to
  a remote server (STR #3435).


cups-str3435.patch:
 util.c |   34 +++++++++++++++++++++++++++++-----
 1 file changed, 29 insertions(+), 5 deletions(-)

--- NEW FILE cups-str3435.patch ---
diff -up cups-1.4.2/cups/util.c.str3435 cups-1.4.2/cups/util.c
--- cups-1.4.2/cups/util.c.str3435	2009-06-22 21:44:34.000000000 +0100
+++ cups-1.4.2/cups/util.c	2009-12-08 12:11:38.647375446 +0000
@@ -1511,12 +1511,36 @@ cupsPrintFiles2(
       return (0);
     }
 
-    status = cupsStartDocument(http, name, job_id, docname, format,
-                               i == (num_files - 1));
+    do
+    {
+      cupsFileRewind(fp);
+
+      status = cupsStartDocument(http, name, job_id, docname, format,
+			         i == (num_files - 1));
+
+      while (status == HTTP_CONTINUE &&
+	     (bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
+        status = cupsWriteRequestData(http, buffer, bytes);
+
+      if (status == HTTP_UNAUTHORIZED)
+      {
+        char	resource[1024];		/* Printer resource */
 
-    while (status == HTTP_CONTINUE &&
-           (bytes = cupsFileRead(fp, buffer, sizeof(buffer))) > 0)
-      status = cupsWriteRequestData(http, buffer, bytes);
+        snprintf(resource, sizeof(resource), "/printers/%s", name);
+
+        if (!cupsDoAuthentication(http, "POST", resource))
+        {
+	  if (httpReconnect(http))
+	  {
+	    _cupsSetError(IPP_SERVICE_UNAVAILABLE, NULL, 0);
+	    return (0);
+	  }
+        }
+	else
+	  status = HTTP_AUTHORIZATION_CANCELED;
+      }
+    }
+    while (status == HTTP_UNAUTHORIZED);
 
     cupsFileClose(fp);
 


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/F-11/cups.spec,v
retrieving revision 1.549
retrieving revision 1.550
diff -u -p -r1.549 -r1.550
--- cups.spec	8 Dec 2009 11:24:11 -0000	1.549
+++ cups.spec	8 Dec 2009 12:13:28 -0000	1.550
@@ -68,6 +68,7 @@ Patch54: cups-str3442.patch
 Patch55: cups-negative-snmp-string-length.patch
 Patch56: cups-sidechannel-intrs.patch
 Patch57: cups-media-empty-warning.patch
+Patch58: cups-str3435.patch
 
 Patch100: cups-lspp.patch
 Epoch: 1
@@ -240,6 +241,7 @@ module. 
 %patch55 -p1 -b .negative-snmp-string-length
 %patch56 -p1 -b .sidechannel-intrs
 %patch57 -p1 -b .media-empty-warning
+%patch58 -p1 -b .str3435
 
 %if %lspp
 %patch100 -p1 -b .lspp
@@ -532,6 +534,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %changelog
 * Tue Dec  8 2009 Tim Waugh <twaugh at redhat.com> - 1:1.4.2-14
+- Authenticated printing did not always work when printing directly to
+  a remote server (STR #3435).
 - Use upstream patch to stop the network backends incorrectly clearing
   the media-empty-warning state (rev 8896).
 - Use upstream patch to fix interrupt handling in the side-channel




More information about the fedora-extras-commits mailing list