From 10d6adef716516a07d897b56b4715a1c0b5d3b6f Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Feb 16 2012 17:24:35 +0000 Subject: Apply patch from upstream revision 9974 to fix encryption upgrades (bug #748988). --- diff --git a/cups-upgrade.patch b/cups-upgrade.patch new file mode 100644 index 0000000..8df3432 --- /dev/null +++ b/cups-upgrade.patch @@ -0,0 +1,75 @@ +diff -up cups-1.4.8/cups/request.c.upgrade cups-1.4.8/cups/request.c +--- cups-1.4.8/cups/request.c.upgrade 2012-02-16 17:01:09.529206191 +0000 ++++ cups-1.4.8/cups/request.c 2012-02-16 17:08:53.228161464 +0000 +@@ -247,16 +247,9 @@ cupsDoIORequest(http_t *http, /* I - + + while ((bytes = (int)read(infile, buffer, sizeof(buffer))) > 0) + { +- if (httpCheck(http)) +- { +- _httpUpdate(http, &status); +- +- if (status >= HTTP_MULTIPLE_CHOICES) +- break; +- } +- +- if (httpWrite2(http, buffer, bytes) < bytes) +- break; ++ if ((status = cupsWriteRequestData(http, buffer, bytes)) ++ != HTTP_CONTINUE) ++ break; + } + } + +@@ -264,13 +257,11 @@ cupsDoIORequest(http_t *http, /* I - + * Get the server's response... + */ + +- if (status == HTTP_CONTINUE || status == HTTP_OK) ++ if (status != HTTP_ERROR) + { + response = cupsGetResponse(http, resource); +- status = http->status; ++ status = httpGetStatus(http); + } +- else +- httpFlush(http); + + DEBUG_printf(("2cupsDoIORequest: status=%d", status)); + +@@ -707,7 +698,17 @@ cupsSendRequest(http_t *http, /* I - + */ + + if (status >= HTTP_MULTIPLE_CHOICES) ++ { ++ _cupsSetHTTPError(status); ++ ++ do ++ { ++ status = httpUpdate(http); ++ } ++ while (status != HTTP_ERROR && http->state == HTTP_POST_RECV); ++ + httpFlush(http); ++ } + + switch (status) + { +@@ -837,7 +838,17 @@ cupsWriteRequestData( + + _httpUpdate(http, &status); + if (status >= HTTP_MULTIPLE_CHOICES) ++ { ++ _cupsSetHTTPError(status); ++ ++ do ++ { ++ status = httpUpdate(http); ++ } ++ while (status != HTTP_ERROR && http->status == HTTP_POST_RECV); ++ + httpFlush(http); ++ } + + return (status); + } diff --git a/cups.spec b/cups.spec index b201e4c..6f5aa35 100644 --- a/cups.spec +++ b/cups.spec @@ -13,7 +13,7 @@ Summary: Common Unix Printing System Name: cups Version: 1.4.8 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2 Group: System Environment/Daemons Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2 @@ -84,6 +84,7 @@ Patch43: cups-avahi-4-poll.patch Patch44: cups-avahi-5-services.patch Patch45: cups-icc.patch +Patch46: cups-upgrade.patch Patch100: cups-lspp.patch @@ -318,6 +319,10 @@ module. # ICC colord support. %patch45 -p1 -b .icc +# Apply patch from upstream revision 9974 to fix encryption upgrades +# (bug #748988). +%patch46 -p1 -b .upgrade + %if %lspp # LSPP support. %patch100 -p1 -b .lspp @@ -647,6 +652,10 @@ rm -rf $RPM_BUILD_ROOT %{php_extdir}/phpcups.so %changelog +* Thu Feb 16 2012 Tim Waugh 1:1.4.8-9 +- Apply patch from upstream revision 9974 to fix encryption upgrades + (bug #748988). + * Tue Jan 17 2012 Tim Waugh 1:1.4.8-8 - Replace newline characters with spaces in reported Device IDs (bug #782129, STR #4005).