extra/cups to 2.4.8-2

This commit is contained in:
Kevin Mihelich 2024-06-03 18:20:26 +00:00
parent 7b4e8947c3
commit c31b793974
4 changed files with 61 additions and 8 deletions

View file

@ -1,7 +1,7 @@
pkgbase = cups pkgbase = cups
pkgver = 2.4.8 pkgver = 2.4.8
pkgrel = 1 pkgrel = 2
epoch = 1 epoch = 2
url = https://openprinting.github.io/cups/ url = https://openprinting.github.io/cups/
arch = x86_64 arch = x86_64
license = Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause license = Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause
@ -22,6 +22,7 @@ pkgbase = cups
source = cups-2.4.0-statedir.patch source = cups-2.4.0-statedir.patch
source = cups-freebind.patch source = cups-freebind.patch
source = guid.patch source = guid.patch
source = 0001-Fix-HTTP-query-in-web-interface-fixes-954.patch
validpgpkeys = 7082A0A50A2E92640F3880E0E4522DCC9B246FF7 validpgpkeys = 7082A0A50A2E92640F3880E0E4522DCC9B246FF7
sha256sums = 75c326b4ba73975efcc9a25078c4b04cdb4ee333caaad0d0823dbd522c6479a0 sha256sums = 75c326b4ba73975efcc9a25078c4b04cdb4ee333caaad0d0823dbd522c6479a0
sha256sums = SKIP sha256sums = SKIP
@ -30,7 +31,8 @@ pkgbase = cups
sha256sums = 06173dfaea37bdd9b39b3e09aba98c34ae7112a2f521db45a688907d8848caa2 sha256sums = 06173dfaea37bdd9b39b3e09aba98c34ae7112a2f521db45a688907d8848caa2
sha256sums = f0b15192952c151b1843742c87850ff3a7d0f3ba5dd236ed16623ef908472ad7 sha256sums = f0b15192952c151b1843742c87850ff3a7d0f3ba5dd236ed16623ef908472ad7
sha256sums = 3385047b9ac8a7b13aeb8f0ca55d15f793ce7283516db0155fe28a67923c592d sha256sums = 3385047b9ac8a7b13aeb8f0ca55d15f793ce7283516db0155fe28a67923c592d
sha256sums = 0bf6a75ba1b051771f155d9a5d36b307a6d40c6857d645b250fe93f3fb713474 sha256sums = 1b1c3268bdff6627b78070b6cd9abec6ef41572c27abbafccb237199f7137653
sha256sums = 2fb4bf61c2c9322d4f3595553d2aa637fee375cc93383922494fd7f76f013e84
pkgname = libcups pkgname = libcups
pkgdesc = OpenPrinting CUPS - client libraries and headers pkgdesc = OpenPrinting CUPS - client libraries and headers

View file

@ -0,0 +1,44 @@
From 2344d33cea725076c794635de0a6ea1b2ac93069 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Tue, 14 May 2024 14:03:44 +0200
Subject: [PATCH] Fix HTTP query in web interface (fixes #954)
We can use `?QUERY=` in URL for searching for destinations
- allow it when checking whether the destination exists.
---
scheduler/client.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scheduler/client.c b/scheduler/client.c
index 8d1c5cc5d..9994f6b5f 100644
--- a/scheduler/client.c
+++ b/scheduler/client.c
@@ -1105,7 +1105,7 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
}
else if (!strncmp(con->uri, "/classes", 8))
{
- if (strlen(con->uri) > 9 && !cupsdFindClass(con->uri + 9))
+ if (strlen(con->uri) > 9 && con->uri[9] != '?' && !cupsdFindClass(con->uri + 9))
{
if (!cupsdSendError(con, HTTP_STATUS_NOT_FOUND, CUPSD_AUTH_NONE))
{
@@ -1125,14 +1125,14 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
else if (!strncmp(con->uri, "/jobs", 5))
{
cupsdSetStringf(&con->command, "%s/cgi-bin/jobs.cgi", ServerBin);
- if (con->uri[5] && con->uri[6])
+ if (con->uri[5] && con->uri[6])
cupsdSetString(&con->options, con->uri + 5);
else
cupsdSetString(&con->options, NULL);
}
- else if (!strncmp(con->uri, "/printers", 9))
+ else if (!strncmp(con->uri, "/printers", 9))
{
- if (strlen(con->uri) > 10 && !cupsdFindPrinter(con->uri + 10))
+ if (strlen(con->uri) > 10 && con->uri[10] != '?' && !cupsdFindPrinter(con->uri + 10))
{
if (!cupsdSendError(con, HTTP_STATUS_NOT_FOUND, CUPSD_AUTH_NONE))
{
--
2.45.0

View file

@ -6,8 +6,8 @@
pkgbase="cups" pkgbase="cups"
pkgname=('libcups' 'cups') pkgname=('libcups' 'cups')
pkgver=2.4.8 pkgver=2.4.8
pkgrel=1 pkgrel=2
epoch=1 epoch=2
arch=('x86_64') arch=('x86_64')
options=(!distcc) options=(!distcc)
license=('Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause') license=('Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause')
@ -23,6 +23,7 @@ source=(https://github.com/OpenPrinting/cups/releases/download/v${pkgver}/cups-$
# bugfixes # bugfixes
cups-freebind.patch cups-freebind.patch
guid.patch guid.patch
0001-Fix-HTTP-query-in-web-interface-fixes-954.patch
) )
sha256sums=('75c326b4ba73975efcc9a25078c4b04cdb4ee333caaad0d0823dbd522c6479a0' sha256sums=('75c326b4ba73975efcc9a25078c4b04cdb4ee333caaad0d0823dbd522c6479a0'
'SKIP' 'SKIP'
@ -31,7 +32,8 @@ sha256sums=('75c326b4ba73975efcc9a25078c4b04cdb4ee333caaad0d0823dbd522c6479a0'
'06173dfaea37bdd9b39b3e09aba98c34ae7112a2f521db45a688907d8848caa2' '06173dfaea37bdd9b39b3e09aba98c34ae7112a2f521db45a688907d8848caa2'
'f0b15192952c151b1843742c87850ff3a7d0f3ba5dd236ed16623ef908472ad7' 'f0b15192952c151b1843742c87850ff3a7d0f3ba5dd236ed16623ef908472ad7'
'3385047b9ac8a7b13aeb8f0ca55d15f793ce7283516db0155fe28a67923c592d' '3385047b9ac8a7b13aeb8f0ca55d15f793ce7283516db0155fe28a67923c592d'
'0bf6a75ba1b051771f155d9a5d36b307a6d40c6857d645b250fe93f3fb713474') '1b1c3268bdff6627b78070b6cd9abec6ef41572c27abbafccb237199f7137653'
'2fb4bf61c2c9322d4f3595553d2aa637fee375cc93383922494fd7f76f013e84')
#validpgpkeys=('3737FD0D0E63B30172440D2DDBA3A7AB08D76223') # CUPS.org (CUPS.org PGP key) <security@cups.org> #validpgpkeys=('3737FD0D0E63B30172440D2DDBA3A7AB08D76223') # CUPS.org (CUPS.org PGP key) <security@cups.org>
#validpgpkeys+=('45D083946E3035282B3CCA9AF434104235DA97EB') # "CUPS.org <security@cups.org>" #validpgpkeys+=('45D083946E3035282B3CCA9AF434104235DA97EB') # "CUPS.org <security@cups.org>"
#validpgpkeys+=('845464660B686AAB36540B6F999559A027815955') # "Michael R Sweet <michael.r.sweet@gmail.com>" #validpgpkeys+=('845464660B686AAB36540B6F999559A027815955') # "Michael R Sweet <michael.r.sweet@gmail.com>"
@ -54,6 +56,9 @@ prepare() {
# FS#56818 - https://github.com/apple/cups/issues/5236 # FS#56818 - https://github.com/apple/cups/issues/5236
patch -Np1 -i "${srcdir}"/guid.patch patch -Np1 -i "${srcdir}"/guid.patch
# Fix HTTP query in web interface - #1
patch -Np1 -i "${srcdir}"/0001-Fix-HTTP-query-in-web-interface-fixes-954.patch
# Rebuild configure script # Rebuild configure script
aclocal -I config-scripts aclocal -I config-scripts
autoconf -I config-scripts autoconf -I config-scripts

View file

@ -1,12 +1,13 @@
--- cups-2.4.0/scheduler/cups-exec.c 2021-11-29 16:19:34.235186064 +0100 --- 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 +++ 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 */ @@ -134,9 +134,15 @@ main(int argc, /* I - Number of command-line args */
# if CUPS_SNAP # if CUPS_SNAP
if (setgroups(0, NULL)) if (setgroups(0, NULL))
# else # else
- if (setgroups(1, &gid)) - if (setgroups(1, &gid))
-# endif /* CUPS_SNAP */ -# endif /* CUPS_SNAP */
+#include <pwd.h> +#include <pwd.h>
+#include <grp.h>
+ struct passwd * pwd = getpwuid(uid); + struct passwd * pwd = getpwuid(uid);
+ if(initgroups(pwd->pw_name,pwd->pw_gid)) + if(initgroups(pwd->pw_name,pwd->pw_gid))
+ { + {
@ -19,13 +20,14 @@
exit(errno + 100); 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 2021-11-29 15:27:31.000000000 +0100
+++ cups-2.4.0/scheduler/util.c.new 2021-11-29 16:29:58.810719066 +0100 +++ cups-2.4.0/scheduler/util.c.new 2021-11-29 16:29:58.810719066 +0100
@@ -296,7 +296,16 @@ @@ -296,7 +296,17 @@
*/ */
if (!getuid() && user) if (!getuid() && user)
- setuid(user); /* Run as restricted user */ - setuid(user); /* Run as restricted user */
+ { + {
+#include <pwd.h> +#include <pwd.h>
+#include <grp.h>
+ struct passwd * pwd = getpwuid(user); + struct passwd * pwd = getpwuid(user);
+ if(initgroups(pwd->pw_name,pwd->pw_gid)) + if(initgroups(pwd->pw_name,pwd->pw_gid))
+ { + {