Date: Tuesday, October 21, 2014 @ 19:53:33 Author: andyrtr Revision: 225152
upgpkg: cups 2.0.0-2 apply upstream fixes for FS#42115, FS#42231, FS#40937, FS#40443 + upstream fix for https://www.cups.org/str.php?L4500; cleanup unneeded downstream patches Added: cups/trunk/str4495.patch cups/trunk/str4497.patch cups/trunk/str4500.patch Modified: cups/trunk/PKGBUILD Deleted: cups/trunk/cups-avahi-address.patch cups/trunk/cups-enum-all.patch cups/trunk/cups-final-content-type.patch cups/trunk/cups-res_init.patch cups/trunk/ppd-poll-with-client-conf.patch ---------------------------------+ PKGBUILD | 37 ++++++++------ cups-avahi-address.patch | 95 -------------------------------------- cups-enum-all.patch | 17 ------ cups-final-content-type.patch | 18 ------- cups-res_init.patch | 26 ---------- ppd-poll-with-client-conf.patch | 18 ------- str4495.patch | 26 ++++++++++ str4497.patch | 43 +++++++++++++++++ str4500.patch | 17 ++++++ 9 files changed, 106 insertions(+), 191 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2014-10-21 16:33:24 UTC (rev 225151) +++ PKGBUILD 2014-10-21 17:53:33 UTC (rev 225152) @@ -20,12 +20,10 @@ cups-1.6.2-statedir.patch cups-1.6.0-fix-install-perms.patch # bugfixes - # cups-res_init.patch # FC - # cups-avahi-address.patch # FC - # cups-enum-all.patch #FC - # cups-final-content-type.patch #FC - # ppd-poll-with-client-conf.patch # Debian -) + str4497.patch + str4495.patch + str4500.patch # FC + ) md5sums=('2cdd81fea23e9e29555c24bdfd0d7c89' 'SKIP' 'fc8286f185e2cc5f7e1f6843bf193e2b' @@ -34,7 +32,10 @@ '1beb4896f217bc241bc08a422274ec0c' '90c30380d4c8cd48a908cfdadae1ea24' '451609db34f95209d64c38474de27ce1' - '5117f65342fcc69c6a506529e4daca9e') + '5117f65342fcc69c6a506529e4daca9e' + '5aab5a160482d89e5d2a4def1f83ef8f' + '84da6459947d4fb62398e9bad7922a11' + '8c0514e41c3b50b2b838b218f683e227') prepare() { @@ -53,18 +54,20 @@ patch -Np0 -i ${srcdir}/cups-1.6.0-fix-install-perms.patch # bug fixes - # Debian patch for http://www.cups.org/str.php?L2763 -# patch -Np1 -i ${srcdir}/ppd-poll-with-client-conf.patch - # FC: Re-initialise the resolver on failure in httpAddrGetList() -# patch -Np1 -i ${srcdir}/cups-res_init.patch - # FC: Use IP address when resolving DNSSD URIs -# patch -Np1 -i ${srcdir}/cups-avahi-address.patch - # FC: Return from cupsEnumDests() once all records have been returned. -# patch -Np1 -i ${srcdir}/cups-enum-all.patch - # FC: Fix printing to some network printers fails - https://bugs.archlinux.org/task/37605 -# patch -Np1 -i ${srcdir}/cups-final-content-type.patch + + # https://www.cups.org/str.php?L4497 + https://www.cups.org/str.php?L4491 + # "Port 631" binds to localhost only (systemd regression) + patch -Np0 -i ${srcdir}/str4497.patch + # https://bugs.archlinux.org/task/40937 - https://www.cups.org/str.php?L4495 + # adds a warning to the config file and honors the FatalErrors directive + patch -Np0 -i ${srcdir}/str4495.patch + # https://www.cups.org/str.php?L4500 + # /etc/cups/ppd/*.ppd not world-readable, cupsGetPPD() returns symlink + patch -Np1 -i ${srcdir}/str4500.patch + + # set MaxLogSize to 0 to prevent using cups internal log rotation sed -i -e '1iMaxLogSize 0' conf/cupsd.conf.in Deleted: cups-avahi-address.patch =================================================================== --- cups-avahi-address.patch 2014-10-21 16:33:24 UTC (rev 225151) +++ cups-avahi-address.patch 2014-10-21 17:53:33 UTC (rev 225152) @@ -1,95 +0,0 @@ -diff -up cups-2.0rc1/cups/http-support.c.avahi-address cups-2.0rc1/cups/http-support.c ---- cups-2.0rc1/cups/http-support.c.avahi-address 2014-08-28 17:37:22.000000000 +0200 -+++ cups-2.0rc1/cups/http-support.c 2014-09-12 15:31:45.062950696 +0200 -@@ -2342,7 +2342,7 @@ http_resolve_cb( - const char *type, /* I - Registration type */ - const char *domain, /* I - Domain (unused) */ - const char *hostTarget, /* I - Hostname */ -- const AvahiAddress *address, /* I - Address (unused) */ -+ const AvahiAddress *address, /* I - Address */ - uint16_t port, /* I - Port number */ - AvahiStringList *txt, /* I - TXT record */ - AvahiLookupResultFlags flags, /* I - Lookup flags (unused) */ -@@ -2495,39 +2495,62 @@ http_resolve_cb( - * getting the IP address of the .local name and then do reverse-lookups... - */ - -- http_addrlist_t *addrlist, /* List of addresses */ -- *addr; /* Current address */ -+ http_addr_t addr; -+ size_t addrlen; -+ int error; - - DEBUG_printf(("8http_resolve_cb: Looking up \"%s\".", hostTarget)); - -- snprintf(fqdn, sizeof(fqdn), "%d", ntohs(port)); -- if ((addrlist = httpAddrGetList(hostTarget, AF_UNSPEC, fqdn)) != NULL) -+ switch (address->proto) - { -- for (addr = addrlist; addr; addr = addr->next) -+ case AVAHI_PROTO_INET: -+ addr.ipv4.sin_family = AF_INET; -+ addrlen = sizeof (addr.ipv4.sin_addr); -+ memcpy (&addr.ipv4.sin_addr, &address->data, addrlen); -+ break; -+ case AVAHI_PROTO_INET6: -+ addr.ipv6.sin6_family = AF_INET6; -+ addrlen = sizeof (addr.ipv6.sin6_addr); -+ memcpy (&addr.ipv6.sin6_addr, &address->data, addrlen); -+ break; -+ default: -+ DEBUG_printf(("8http_resolve_cb: unknown address family %d", -+ address->proto)); -+ addrlen = 0; -+ } -+ -+ if (addrlen > 0) { -+ error = getnameinfo(&addr.addr, httpAddrLength (&addr), -+ fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD); -+ -+ if (!error) - { -- int error = getnameinfo(&(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr)), fqdn, sizeof(fqdn), NULL, 0, NI_NAMEREQD); -+ DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn)); - -- if (!error) -- { -- DEBUG_printf(("8http_resolve_cb: Found \"%s\".", fqdn)); -+ if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn || -+ _cups_strcasecmp(hostptr, ".local")) - -- if ((hostptr = fqdn + strlen(fqdn) - 6) <= fqdn || -- _cups_strcasecmp(hostptr, ".local")) -- { -- hostTarget = fqdn; -- break; -- } -+ { -+ hostTarget = fqdn; - } -+ } else { -+ avahi_address_snprint (fqdn, sizeof (fqdn), address); -+ hostTarget = fqdn; -+ - #ifdef DEBUG -- else -- DEBUG_printf(("8http_resolve_cb: \"%s\" did not resolve: %d", -- httpAddrString(&(addr->addr), fqdn, sizeof(fqdn)), -- error)); -+ DEBUG_printf(("8http_resolve_cb: \"%s\" did not resolve: %d", -+ fqdn, error)); - #endif /* DEBUG */ - } - -- httpAddrFreeList(addrlist); - } -+ } else { -+ /* -+ * Use the IP address that responded... -+ */ -+ -+ avahi_address_snprint (fqdn, sizeof (fqdn), address); -+ hostTarget = fqdn; - } - - /* Deleted: cups-enum-all.patch =================================================================== --- cups-enum-all.patch 2014-10-21 16:33:24 UTC (rev 225151) +++ cups-enum-all.patch 2014-10-21 17:53:33 UTC (rev 225152) @@ -1,17 +0,0 @@ -diff -up cups-1.6.2/cups/dest.c.enum-all cups-1.6.2/cups/dest.c ---- cups-1.6.2/cups/dest.c.enum-all 2013-06-04 10:58:36.169786250 +0100 -+++ cups-1.6.2/cups/dest.c 2013-06-04 10:59:02.147900811 +0100 -@@ -2724,9 +2724,12 @@ cups_dnssd_browse_cb( - break; - - case AVAHI_BROWSER_REMOVE: -- case AVAHI_BROWSER_ALL_FOR_NOW: - case AVAHI_BROWSER_CACHE_EXHAUSTED: - break; -+ -+ case AVAHI_BROWSER_ALL_FOR_NOW: -+ avahi_simple_poll_quit(data->simple_poll); -+ break; - } - } - Deleted: cups-final-content-type.patch =================================================================== --- cups-final-content-type.patch 2014-10-21 16:33:24 UTC (rev 225151) +++ cups-final-content-type.patch 2014-10-21 17:53:33 UTC (rev 225152) @@ -1,18 +0,0 @@ -diff -up cups-1.6.4/scheduler/job.c.final-content-type cups-1.6.4/scheduler/job.c ---- cups-1.6.4/scheduler/job.c.final-content-type 2013-09-27 16:58:13.934775402 +0100 -+++ cups-1.6.4/scheduler/job.c 2013-09-27 17:00:57.716549576 +0100 -@@ -692,12 +692,7 @@ cupsdContinueJob(cupsd_job_t *job) /* I - - if (!job->printer->remote) - { -- for (filter = (mime_filter_t *)cupsArrayLast(filters); -- filter && filter->dst; -- filter = (mime_filter_t *)cupsArrayPrev(filters)) -- if (strcmp(filter->dst->super, "printer") || -- strcmp(filter->dst->type, job->printer->name)) -- break; -+ filter = (mime_filter_t *)cupsArrayLast(filters); - - if (filter && filter->dst) - { - Deleted: cups-res_init.patch =================================================================== --- cups-res_init.patch 2014-10-21 16:33:24 UTC (rev 225151) +++ cups-res_init.patch 2014-10-21 17:53:33 UTC (rev 225152) @@ -1,26 +0,0 @@ -diff -up cups-1.7b1/cups/http-addr.c.res_init cups-1.7b1/cups/http-addr.c ---- cups-1.7b1/cups/http-addr.c.res_init 2013-03-20 19:14:10.000000000 +0100 -+++ cups-1.7b1/cups/http-addr.c 2013-04-19 12:01:36.927512159 +0200 -@@ -319,7 +319,8 @@ httpAddrLookup( - - if (error) - { -- if (error == EAI_FAIL) -+ if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA || -+ error == EAI_NONAME) - cg->need_res_init = 1; - - return (httpAddrString(addr, name, namelen)); -diff -up cups-1.7b1/cups/http-addrlist.c.res_init cups-1.7b1/cups/http-addrlist.c ---- cups-1.7b1/cups/http-addrlist.c.res_init 2013-04-19 12:01:36.930512119 +0200 -+++ cups-1.7b1/cups/http-addrlist.c 2013-04-19 12:03:13.769229554 +0200 -@@ -581,7 +581,8 @@ httpAddrGetList(const char *hostname, /* - } - else - { -- if (error == EAI_FAIL) -+ if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA || -+ error == EAI_NONAME) - cg->need_res_init = 1; - - _cupsSetError(IPP_STATUS_ERROR_INTERNAL, gai_strerror(error), 0); Deleted: ppd-poll-with-client-conf.patch =================================================================== --- ppd-poll-with-client-conf.patch 2014-10-21 16:33:24 UTC (rev 225151) +++ ppd-poll-with-client-conf.patch 2014-10-21 17:53:33 UTC (rev 225152) @@ -1,18 +0,0 @@ -Description: If an external server is used via client.conf and the DNS - is inconsistent (ex: DNS gives "noname" for many IPs, reverse DNS gives - one of these IPs for "noname") local PPDs can get polled for print - queues instead of the PPDs of the external server -Bug: http://www.cups.org/str.php?L2763 -Last-Updated: 2014-01-03 - ---- a/cups/util.c -+++ b/cups/util.c -@@ -1088,6 +1088,8 @@ - http2 = http; - else if ((http2 = httpConnect2(hostname, port, NULL, AF_UNSPEC, - cupsEncryption(), 1, 30000, NULL)) == NULL) -+ if ((http2 = httpConnect2(http_hostname, http_port, NULL, AF_UNSPEC, -+ cupsEncryption(), 1, 30000, NULL)) == NULL) - { - DEBUG_puts("1cupsGetPPD3: Unable to connect to server"); - Added: str4495.patch =================================================================== --- str4495.patch (rev 0) +++ str4495.patch 2014-10-21 17:53:33 UTC (rev 225152) @@ -0,0 +1,26 @@ +Index: conf/cups-files.conf.in +=================================================================== +--- conf/cups-files.conf.in (revision 12220) ++++ conf/cups-files.conf.in (working copy) +@@ -15,6 +15,7 @@ + #Group @CUPS_GROUP@ + + # Administrator user group, used to match @SYSTEM in cupsd.conf policy rules... ++# This cannot contain the Group value for security reasons... + SystemGroup @CUPS_SYSTEM_GROUPS@ + @CUPS_SYSTEM_AUTHKEY@ + +Index: scheduler/conf.c +=================================================================== +--- scheduler/conf.c (revision 12220) ++++ scheduler/conf.c (working copy) +@@ -995,6 +995,9 @@ + + cupsdLogMessage(CUPSD_LOG_NOTICE, + "Group and SystemGroup cannot use the same groups."); ++ if (FatalErrors & (CUPSD_FATAL_CONFIG | CUPSD_FATAL_PERMISSIONS)) ++ return (0); ++ + cupsdLogMessage(CUPSD_LOG_INFO, "Resetting Group to \"nobody\"..."); + + group = getgrnam("nobody"); Added: str4497.patch =================================================================== --- str4497.patch (rev 0) +++ str4497.patch 2014-10-21 17:53:33 UTC (rev 225152) @@ -0,0 +1,43 @@ +Index: scheduler/main.c +=================================================================== +--- scheduler/main.c (revision 12213) ++++ scheduler/main.c (working copy) +@@ -763,6 +763,9 @@ + + if (timeout == 86400 && OnDemand && IdleExitTimeout && + !cupsArrayCount(ActiveJobs) && ++# ifdef HAVE_SYSTEMD ++ !WebInterface && ++# endif /* HAVE_SYSTEMD */ + (!Browsing || !BrowseLocalProtocols || !cupsArrayCount(Printers))) + { + timeout = IdleExitTimeout; +@@ -2114,8 +2117,12 @@ + * jobs or shared printers to advertise... + */ + +- if (cupsArrayCount(ActiveJobs) || ++ if (cupsArrayCount(ActiveJobs) || /* Active jobs */ ++# ifdef HAVE_SYSTEMD ++ WebInterface || /* Web interface enabled */ ++# endif /* HAVE_SYSTEMD */ + (Browsing && BrowseLocalProtocols && cupsArrayCount(Printers))) ++ /* Printers being shared */ + { + cupsdLogMessage(CUPSD_LOG_DEBUG, "Creating keep-alive file \"" CUPS_KEEPALIVE "\"."); + +Index: scheduler/org.cups.cupsd.socket.in +=================================================================== +--- scheduler/org.cups.cupsd.socket.in (revision 12213) ++++ scheduler/org.cups.cupsd.socket.in (working copy) +@@ -3,10 +3,6 @@ + + [Socket] + ListenStream=@CUPS_DEFAULT_DOMAINSOCKET@ +-ListenStream=[::1]:631 +-ListenStream=127.0.0.1:631 +-BindIPv6Only=ipv6-only +-ReusePort=true + + [Install] + WantedBy=sockets.target Added: str4500.patch =================================================================== --- str4500.patch (rev 0) +++ str4500.patch 2014-10-21 17:53:33 UTC (rev 225152) @@ -0,0 +1,17 @@ +diff -up cups-2.0.0/cups/util.c.str4500 cups-2.0.0/cups/util.c +--- cups-2.0.0/cups/util.c.str4500 2014-10-15 12:59:27.105942488 +0100 ++++ cups-2.0.0/cups/util.c 2014-10-15 13:03:38.618187112 +0100 +@@ -846,10 +846,10 @@ cupsGetPPD3(http_t *http, /* I - H + + snprintf(ppdname, sizeof(ppdname), "%s/ppd/%s.ppd", cg->cups_serverroot, + name); +- if (!stat(ppdname, &ppdinfo)) ++ if (!stat(ppdname, &ppdinfo) && !access(ppdname, R_OK)) + { + /* +- * OK, the file exists, use it! ++ * OK, the file exists and is readable, use it! + */ + + if (buffer[0]) +