[arch-commits] Commit in lib32-libcups/trunk (PKGBUILD cups-freebind.patch guid.patch)

Antonio Rojas arojas at gemini.archlinux.org
Mon Dec 6 20:59:20 UTC 2021


    Date: Monday, December 6, 2021 @ 20:59:20
  Author: arojas
Revision: 1065381

Update to 2.4.0

Added:
  lib32-libcups/trunk/cups-freebind.patch
  lib32-libcups/trunk/guid.patch
Modified:
  lib32-libcups/trunk/PKGBUILD

---------------------+
 PKGBUILD            |   19 ++++++++++++-------
 cups-freebind.patch |   15 +++++++++++++++
 guid.patch          |   39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 66 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-12-06 20:57:22 UTC (rev 1065380)
+++ PKGBUILD	2021-12-06 20:59:20 UTC (rev 1065381)
@@ -2,7 +2,7 @@
 
 _pkgbasename=libcups
 pkgname=lib32-$_pkgbasename
-pkgver=2.3.3
+pkgver=2.4.0
 pkgrel=1
 pkgdesc="The CUPS Printing System - client libraries (32-bit)"
 arch=('x86_64')
@@ -9,11 +9,16 @@
 license=('Apache' 'custom')
 url="https://www.cups.org/"
 depends=(lib32-krb5 lib32-libtiff lib32-libpng lib32-gnutls $_pkgbasename)
-source=(https://github.com/apple/cups/releases/download/v${pkgver}/cups-${pkgver}-source.tar.gz{,.sig})
-sha256sums=('261fd948bce8647b6d5cb2a1784f0c24cc52b5c4e827b71d726020bcc502f3ee'
-            'SKIP')
-validpgpkeys=('3737FD0D0E63B30172440D2DDBA3A7AB08D76223'  # CUPS.org (CUPS.org PGP key) <security at cups.org>
-              '45D083946E3035282B3CCA9AF434104235DA97EB') # "CUPS.org <security at cups.org>"     
+source=(https://github.com/OpenPrinting/cups/releases/download/v${pkgver}/cups-${pkgver}-source.tar.gz{,.sig}
+        cups-freebind.patch
+        guid.patch
+)
+sha256sums=('9abecec128ca6847c5bb2d3e3d30c87b782c0697b9acf284d16fa38f80a3a6de'
+            'SKIP'
+            '3385047b9ac8a7b13aeb8f0ca55d15f793ce7283516db0155fe28a67923c592d'
+            '0bf6a75ba1b051771f155d9a5d36b307a6d40c6857d645b250fe93f3fb713474')
+validpgpkeys=('7ADB58203CA5F046F28025B215AA6A7F4D4227D7') # "Zdenek Dohnal (Associate Software Engineer) <zdohnal at redhat.com>"
+
 build() {
   export CC="gcc -m32"
   export CXX="g++ -m32"
@@ -27,7 +32,7 @@
   ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
      --disable-ldap --enable-raw-printing --disable-gssapi --disable-dbus \
      --enable-ssl=yes--enable-threads --enable-libusb=no \
-	 --disable-avahi --disable-dnssd \
+	 --with-dnssd=no \
      --with-optim="$CFLAGS" --libdir=/usr/lib32
   make libs
 }

Added: cups-freebind.patch
===================================================================
--- cups-freebind.patch	                        (rev 0)
+++ cups-freebind.patch	2021-12-06 20:59:20 UTC (rev 1065381)
@@ -0,0 +1,15 @@
+diff -up cups-2.0.2/cups/http-addr.c.freebind cups-2.0.2/cups/http-addr.c
+--- cups-2.0.2/cups/http-addr.c.freebind	2015-02-10 14:46:33.000000000 +0100
++++ cups-2.0.2/cups/http-addr.c	2015-02-10 14:50:35.074759141 +0100
+@@ -186,6 +186,10 @@ httpAddrListen(http_addr_t *addr,	/* I -
+   val = 1;
+   setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, CUPS_SOCAST &val, sizeof(val));
+ 
++#ifdef __linux
++  setsockopt(fd, IPPROTO_IP, IP_FREEBIND, CUPS_SOCAST &val, sizeof(val));
++#endif /* __linux */
++
+ #ifdef IPV6_V6ONLY
+   if (addr->addr.sa_family == AF_INET6)
+     setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, CUPS_SOCAST &val, sizeof(val));
+diff -up cups-2.0.2/scheduler/listen.c.freebind cups-2.0.2/scheduler/listen.c

Added: guid.patch
===================================================================
--- guid.patch	                        (rev 0)
+++ guid.patch	2021-12-06 20:59:20 UTC (rev 1065381)
@@ -0,0 +1,39 @@
+--- cups-2.4.0/scheduler/cups-exec.c	2021-11-29 16:19:34.235186064 +0100
++++ cups-2.4.0/scheduler/cups-exec.c.new	2021-11-29 16:25:30.764049649 +0100
+@@ -134,9 +134,14 @@ main(int  argc,				/* I - Number of command-line args */
+ #  if CUPS_SNAP
+     if (setgroups(0, NULL))
+ #  else
+-    if (setgroups(1, &gid))
+-#  endif /* CUPS_SNAP */
++#include <pwd.h>
++    struct passwd * pwd = getpwuid(uid);
++    if(initgroups(pwd->pw_name,pwd->pw_gid))
++    {
++      fprintf(stderr, "DEBUG: initgroups failed\n");
+       exit(errno + 100);
++    }
++#  endif /* CUPS_SNAP */
+ 
+     if (uid && setuid(uid))
+       exit(errno + 100);
+--- cups-2.4.0/scheduler/util.c	2021-11-29 15:27:31.000000000 +0100
++++ cups-2.4.0/scheduler/util.c.new	2021-11-29 16:29:58.810719066 +0100
+@@ -296,7 +296,16 @@
+     */
+ 
+     if (!getuid() && user)
+-      setuid(user);			/* Run as restricted user */
++    {
++#include <pwd.h>
++      struct passwd * pwd = getpwuid(user);
++      if(initgroups(pwd->pw_name,pwd->pw_gid))
++      {
++        fprintf(stderr, "DEBUG: initgroups failed\n");
++        exit(errno + 100);
++      }
++      setuid(user); /* Run as restricted user */
++    }
+ 
+     if ((fd = open("/dev/null", O_RDONLY)) > 0)
+     {



More information about the arch-commits mailing list