[arch-commits] Commit in cups/trunk (PKGBUILD fix_endless_loops.diff)
Andreas Radke
andyrtr at archlinux.org
Wed Sep 21 14:40:36 UTC 2016
Date: Wednesday, September 21, 2016 @ 14:40:36
Author: andyrtr
Revision: 276803
upgpkg: cups 2.2.0-3
apply upstream fix for libcups running in endless loops FS#50796
Added:
cups/trunk/fix_endless_loops.diff
Modified:
cups/trunk/PKGBUILD
------------------------+
PKGBUILD | 8 +++++-
fix_endless_loops.diff | 54 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 2 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2016-09-21 12:39:53 UTC (rev 276802)
+++ PKGBUILD 2016-09-21 14:40:36 UTC (rev 276803)
@@ -4,7 +4,7 @@
pkgbase="cups"
pkgname=('libcups' 'cups')
pkgver=2.2.0
-pkgrel=2
+pkgrel=3
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.cups.org/"
@@ -22,6 +22,7 @@
# bugfixes
cups-systemd-socket.patch
start_cups_by_port631.diff
+ fix_endless_loops.diff
)
md5sums=('e22d943cff300411d3616dc2ee86272c'
'fc8286f185e2cc5f7e1f6843bf193e2b'
@@ -32,7 +33,8 @@
'451609db34f95209d64c38474de27ce1'
'5117f65342fcc69c6a506529e4daca9e'
'53bb3c80ee6823d36f9ab499373edfc5'
- 'f75c17b1b2d446a27b629f63622b9468')
+ 'f75c17b1b2d446a27b629f63622b9468'
+ '32f6e1f907247dab466c37403d87d4e4')
validpgpkeys=('3737FD0D0E63B30172440D2DDBA3A7AB08D76223') # CUPS.org (CUPS.org PGP key) <security at cups.org>
prepare() {
@@ -56,6 +58,8 @@
patch -Np1 -i ${srcdir}/cups-systemd-socket.patch
# make sure cupsd starts when requested via web interface
patch -Np1 -i ${srcdir}/start_cups_by_port631.diff
+ # fix endless loops; FS#50796; https://github.com/apple/cups/issues/4870
+ patch -Np1 -i ${srcdir}/fix_endless_loops.diff
# set MaxLogSize to 0 to prevent using cups internal log rotation
sed -i -e '5i\ ' conf/cupsd.conf.in
Added: fix_endless_loops.diff
===================================================================
--- fix_endless_loops.diff (rev 0)
+++ fix_endless_loops.diff 2016-09-21 14:40:36 UTC (rev 276803)
@@ -0,0 +1,54 @@
+diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c
+index 6e2ad81..e9ef53e 100644
+--- a/cups/http-addrlist.c
++++ b/cups/http-addrlist.c
+@@ -304,6 +304,8 @@ httpAddrConnect2(
+
+ if (result > 0)
+ {
++ http_addrlist_t *connaddr = NULL; /* Connected address, if any */
++
+ for (i = 0; i < nfds; i ++)
+ {
+ # ifdef HAVE_POLL
+@@ -314,7 +316,7 @@ httpAddrConnect2(
+ # endif /* HAVE_POLL */
+ {
+ *sock = fds[i];
+- addrlist = addrs[i];
++ connaddr = addrs[i];
+
+ # ifdef DEBUG
+ len = sizeof(peer);
+@@ -322,11 +324,29 @@ httpAddrConnect2(
+ DEBUG_printf(("1httpAddrConnect2: Connected to %s:%d...", httpAddrString(&peer, temp, sizeof(temp)), httpAddrPort(&peer)));
+ # endif /* DEBUG */
+ }
+- else
++# ifdef HAVE_POLL
++ else if (pfds[i].revents & (POLLERR | POLLHUP))
++# else
++ else if (FD_ISSET(fds[i], &error))
++# endif /* HAVE_POLL */
++ {
++ /*
++ * Error on socket, remove from the "pool"...
++ */
++
+ httpAddrClose(NULL, fds[i]);
++ nfds --;
++ if (i < nfds)
++ {
++ memmove(fds + i, fds + i + 1, (size_t)(nfds - i) * (sizeof(fds[0])));
++ memmove(addrs + i, addrs + i + 1, (size_t)(nfds - i) * (sizeof(addrs[0])));
++ }
++ i --;
++ }
+ }
+
+- return (addrlist);
++ if (connaddr)
++ return (connaddr);
+ }
+ #endif /* O_NONBLOCK */
+
More information about the arch-commits
mailing list