From 8425e43657a1d7f4e3d5ffa7459602fa922b2850 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Fri, 9 May 2014 15:45:31 +0100 Subject: [PATCH 1/2] Another attempt at avoiding race condition when sending IPP requests (STR #4386, bug #1072952). Resolves: rhbz#1072952 (cherry picked from commit e3384fee5967f966cd70b5dee3b308301ddaf57e) Conflicts: cups.spec --- cups-str4386.patch | 44 ++++++++++++++++++++++++++++++++++++++++++++ cups.spec | 10 +++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 cups-str4386.patch diff --git a/cups-str4386.patch b/cups-str4386.patch new file mode 100644 index 0000000..e2da700 --- /dev/null +++ b/cups-str4386.patch @@ -0,0 +1,44 @@ +diff -up cups-1.7.2/cups/request.c.str4386 cups-1.7.2/cups/request.c +--- cups-1.7.2/cups/request.c.str4386 2014-03-26 21:06:04.000000000 +0000 ++++ cups-1.7.2/cups/request.c 2014-04-16 14:02:20.039876149 +0100 +@@ -749,9 +749,8 @@ cupsSendRequest(http_t *http, /* I - + got_status = 0; + + while ((state = ippWrite(http, request)) != IPP_STATE_DATA) +- if (state == IPP_STATE_ERROR) +- break; +- else if (httpCheck(http)) ++ { ++ if (httpCheck(http)) + { + got_status = 1; + +@@ -759,15 +758,24 @@ cupsSendRequest(http_t *http, /* I - + if (status >= HTTP_STATUS_MULTIPLE_CHOICES) + break; + } ++ else if (state == IPP_STATE_ERROR) ++ break; ++ } + + if (state == IPP_STATE_ERROR) + { +- DEBUG_puts("1cupsSendRequest: Unable to send IPP request."); ++ /* We weren't able to send the IPP request. But did we already ++ * get an HTTP error status? */ ++ if (!(got_status && status >= HTTP_STATUS_MULTIPLE_CHOICES)) ++ { ++ /* No, something else went wrong. */ ++ DEBUG_puts("1cupsSendRequest: Unable to send IPP request."); + +- http->status = HTTP_STATUS_ERROR; +- http->state = HTTP_STATE_WAITING; ++ http->status = HTTP_STATUS_ERROR; ++ http->state = HTTP_STATE_WAITING; + +- return (HTTP_STATUS_ERROR); ++ return (HTTP_STATUS_ERROR); ++ } + } + + /* diff --git a/cups.spec b/cups.spec index 9f95b9f..03bdb08 100644 --- a/cups.spec +++ b/cups.spec @@ -11,7 +11,7 @@ Summary: CUPS printing system Name: cups Epoch: 1 Version: 1.7.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2 Url: http://www.cups.org/ Source: http://www.cups.org/software/%{version}/cups-%{version}-source.tar.bz2 @@ -30,6 +30,7 @@ Source8: macros.cups Patch1: cups-no-gzip-man.patch Patch2: cups-system-auth.patch Patch3: cups-multilib.patch +Patch4: cups-str4386.patch Patch5: cups-banners.patch Patch6: cups-serverbin-compat.patch Patch7: cups-no-export-ssllibs.patch @@ -180,6 +181,9 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch2 -p1 -b .system-auth # Prevent multilib conflict in cups-config script. %patch3 -p1 -b .multilib +# Apply patch to fix cupsSendRequest() race condition (bug #1072952, +# STR #4386). +%patch4 -p1 -b .str4386 # Ignore rpm save/new files in the banners directory. %patch5 -p1 -b .banners # Use compatibility fallback path for ServerBin. @@ -636,6 +640,10 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Fri May 9 2014 Tim Waugh - 1:1.7.2-2 +- Another attempt at avoiding race condition when sending IPP requests + (STR #4386, bug #1072952). + * Mon Apr 14 2014 Jiri Popelka - 1:1.7.2-1 - 1.7.2 From 09220e03195e2a55b96c53867336fbd7615874ef Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Wed, 28 May 2014 10:24:09 +0200 Subject: [PATCH 2/2] 1.7.3 --- .gitignore | 1 + cups-1.7.2-source.tar.bz2.sig | Bin 543 -> 0 bytes cups-1.7.3-source.tar.bz2.sig | Bin 0 -> 543 bytes cups-str4386.patch | 44 ---------------------------------- cups.spec | 16 ++++++++----- sources | 2 +- 6 files changed, 12 insertions(+), 51 deletions(-) delete mode 100644 cups-1.7.2-source.tar.bz2.sig create mode 100644 cups-1.7.3-source.tar.bz2.sig delete mode 100644 cups-str4386.patch diff --git a/.gitignore b/.gitignore index ff93a17..e755438 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ cups-1.4.4-source.tar.bz2 /cups-1.7.0-source.tar.bz2 /cups-1.7.1-source.tar.bz2 /cups-1.7.2-source.tar.bz2 +/cups-1.7.3-source.tar.bz2 diff --git a/cups-1.7.2-source.tar.bz2.sig b/cups-1.7.2-source.tar.bz2.sig deleted file mode 100644 index b3a5de8217cfa1deb9217803bb4023aff3c05d0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 543 zcmV+)0^t3L0vrSY0SW*H1p-q>xQqY_2@u<(r>h9pVk2iq5C2iT8Y+sqULg7b`;Ex) zOHYM(avN~cdVh$ADWOgBy@;WT zca+Ii(#4pDXOgH%=Fks1idT=+VVyd{!~@8@i+$cg?Wl2&}|)B(asa{hHZ; zH0OV&t{ue3j&+3sB*p!s<65&la}+`iA&9!@;|97II0Czt)RJl(kYw!NdD$eyI!c%9 zFsrw}O8>lNDNb4yr}gu17O2lfsuIZ^P-Ovj-UZA1qc73xG}mtTH&PXNbC!qdz> z5Mqg0O*QKi2E%TRzKPE;%V1@1&#R96=SeV3)DaZITNUIps?EQ~;iOy6K)D~NtB>W+ h*_)SklWt#22m0Kv%3Q(ZE(J80&hTk4-ReCwn_fHv3XA{% diff --git a/cups-1.7.3-source.tar.bz2.sig b/cups-1.7.3-source.tar.bz2.sig new file mode 100644 index 0000000000000000000000000000000000000000..1a888e0fbf15639df600dc014967de4e0ce221d2 GIT binary patch literal 543 zcmV+)0^t3L0vrSY0SW*H1p-rq+JFEG2@u<(r>h9pVk5wL5C2X+Y7*tR@qjaMuiw8B zs!#>QO&w*}os~%11)EBNq8Ruy0sCW%ML2j;dLy9|HEij~v8MHs3*Hr&mWCpWeJy6$ zP@hIhmnjK5C=O|mv$;rn&psm=EZ%tY=H%w)V%Ul@fA-kK@iLCpQoM;;$6B`8HLqGI zoOqf)vIswXDY#N5>r9wZ9WhT%)V zGbkA{$uOjs;W%Y89H!Mx^~(8*2xw=N5eEr#Ot67v{O|O;^7p}l#h^~Vo6))=ptf>Z zUVG8;=;od~DrXIFmcIGoGz|=i4qIfdQ$k}Pso)L~h@O#ehZ7Rkhi#NGXijt}#0^$z z^4=D#dKe`XOzx)5Je|(U-~)rLo|nQBHI^D7*hVuSO+)YjlC6;X^dx;pS) zH7DLI(IMK6WT<$y^%=r=m3Gq|Beswfk|RKPELHLYVX&?}*j>P#9{D1tLB$a)(Tpc9 hpdfL`hr|f(v|NNqAJ6)!;9bJK>JJ#6zm&}9Ekb$&1+4%8 literal 0 HcmV?d00001 diff --git a/cups-str4386.patch b/cups-str4386.patch deleted file mode 100644 index e2da700..0000000 --- a/cups-str4386.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -up cups-1.7.2/cups/request.c.str4386 cups-1.7.2/cups/request.c ---- cups-1.7.2/cups/request.c.str4386 2014-03-26 21:06:04.000000000 +0000 -+++ cups-1.7.2/cups/request.c 2014-04-16 14:02:20.039876149 +0100 -@@ -749,9 +749,8 @@ cupsSendRequest(http_t *http, /* I - - got_status = 0; - - while ((state = ippWrite(http, request)) != IPP_STATE_DATA) -- if (state == IPP_STATE_ERROR) -- break; -- else if (httpCheck(http)) -+ { -+ if (httpCheck(http)) - { - got_status = 1; - -@@ -759,15 +758,24 @@ cupsSendRequest(http_t *http, /* I - - if (status >= HTTP_STATUS_MULTIPLE_CHOICES) - break; - } -+ else if (state == IPP_STATE_ERROR) -+ break; -+ } - - if (state == IPP_STATE_ERROR) - { -- DEBUG_puts("1cupsSendRequest: Unable to send IPP request."); -+ /* We weren't able to send the IPP request. But did we already -+ * get an HTTP error status? */ -+ if (!(got_status && status >= HTTP_STATUS_MULTIPLE_CHOICES)) -+ { -+ /* No, something else went wrong. */ -+ DEBUG_puts("1cupsSendRequest: Unable to send IPP request."); - -- http->status = HTTP_STATUS_ERROR; -- http->state = HTTP_STATE_WAITING; -+ http->status = HTTP_STATUS_ERROR; -+ http->state = HTTP_STATE_WAITING; - -- return (HTTP_STATUS_ERROR); -+ return (HTTP_STATUS_ERROR); -+ } - } - - /* diff --git a/cups.spec b/cups.spec index 03bdb08..42f6ac0 100644 --- a/cups.spec +++ b/cups.spec @@ -10,8 +10,8 @@ Summary: CUPS printing system Name: cups Epoch: 1 -Version: 1.7.2 -Release: 2%{?dist} +Version: 1.7.3 +Release: 1%{?dist} License: GPLv2 Url: http://www.cups.org/ Source: http://www.cups.org/software/%{version}/cups-%{version}-source.tar.bz2 @@ -30,7 +30,6 @@ Source8: macros.cups Patch1: cups-no-gzip-man.patch Patch2: cups-system-auth.patch Patch3: cups-multilib.patch -Patch4: cups-str4386.patch Patch5: cups-banners.patch Patch6: cups-serverbin-compat.patch Patch7: cups-no-export-ssllibs.patch @@ -181,9 +180,6 @@ Sends IPP requests to the specified URI and tests and/or displays the results. %patch2 -p1 -b .system-auth # Prevent multilib conflict in cups-config script. %patch3 -p1 -b .multilib -# Apply patch to fix cupsSendRequest() race condition (bug #1072952, -# STR #4386). -%patch4 -p1 -b .str4386 # Ignore rpm save/new files in the banners directory. %patch5 -p1 -b .banners # Use compatibility fallback path for ServerBin. @@ -527,6 +523,7 @@ rm -f %{cups_serverbin}/backend/smb %dir %{_datadir}/%{name}/www/fr %dir %{_datadir}/%{name}/www/it %dir %{_datadir}/%{name}/www/ja +%dir %{_datadir}/%{name}/www/pt_BR %dir %{_datadir}/%{name}/www/ru %{_datadir}/%{name}/www/images %{_datadir}/%{name}/www/*.css @@ -540,6 +537,7 @@ rm -f %{cups_serverbin}/backend/smb %doc %{_datadir}/%{name}/www/fr/index.html %doc %{_datadir}/%{name}/www/it/index.html %doc %{_datadir}/%{name}/www/ja/index.html +%doc %{_datadir}/%{name}/www/pt_BR/index.html %doc %{_datadir}/%{name}/www/ru/index.html %dir %{_datadir}/%{name}/usb %{_datadir}/%{name}/usb/org.cups.usb-quirks @@ -577,6 +575,7 @@ rm -f %{cups_serverbin}/backend/smb %dir %{_datadir}/cups/templates/fr %dir %{_datadir}/cups/templates/it %dir %{_datadir}/cups/templates/ja +%dir %{_datadir}/cups/templates/pt_BR %dir %{_datadir}/cups/templates/ru %{_datadir}/cups/templates/*.tmpl %{_datadir}/cups/templates/ca/*.tmpl @@ -586,6 +585,7 @@ rm -f %{cups_serverbin}/backend/smb %{_datadir}/cups/templates/fr/*.tmpl %{_datadir}/cups/templates/it/*.tmpl %{_datadir}/cups/templates/ja/*.tmpl +%{_datadir}/cups/templates/pt_BR/*.tmpl %{_datadir}/cups/templates/ru/*.tmpl %dir %attr(1770,root,lp) %{_localstatedir}/spool/cups/tmp %dir %attr(0710,root,lp) %{_localstatedir}/spool/cups @@ -640,6 +640,10 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Wed May 28 2014 Jiri Popelka - 1:1.7.3-1 +- 1.7.3 +- str4386.patch merged upstream in STR #4403 + * Fri May 9 2014 Tim Waugh - 1:1.7.2-2 - Another attempt at avoiding race condition when sending IPP requests (STR #4386, bug #1072952). diff --git a/sources b/sources index 1f8167c..bcab508 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f06a997d4b71b81b23324e27174f93e7 cups-1.7.2-source.tar.bz2 +d498c3020acda0904ab0c13b6389a1ec cups-1.7.3-source.tar.bz2