extra/cups to 2.2.8-3

This commit is contained in:
Kevin Mihelich 2018-06-22 17:19:06 +00:00
parent 0b7f5b253f
commit 29b65904a5
4 changed files with 90 additions and 81 deletions

View file

@ -6,37 +6,40 @@
pkgbase="cups"
pkgname=('libcups' 'cups')
pkgver=2.2.7
pkgrel=2
pkgver=2.2.8
pkgrel=3
arch=('x86_64')
license=('GPL')
url="https://www.cups.org/"
makedepends=('libtiff' 'libpng' 'acl' 'pam' 'xdg-utils' 'krb5' 'gnutls'
'cups-filters' 'bc' 'colord' 'xinetd' 'gzip' 'autoconf' 'libusb' 'dbus'
'cups-filters' 'bc' 'colord' 'xinetd' 'gzip' 'autoconf' 'libusb' 'dbus'
'avahi' 'hicolor-icon-theme' 'systemd' 'inetutils' 'libpaper')
source=(https://github.com/apple/cups/releases/download/v${pkgver}/cups-${pkgver}-source.tar.gz{,.sig}
cups.logrotate cups.pam
cups.sysusers guid.patch
cups.logrotate
cups.pam
cups.sysusers
# improve build and linking
cups-no-export-ssllibs.patch
cups-no-gzip-man.patch
cups-1.6.2-statedir.patch
# bugfixes
auth-workaround-for-certain-web-browsers.patch
cups-systemd-socket.patch)
sha256sums=('3c4b637b737077565ccdfbd5f61785d03f49461ae736fcc2c0ffaf41d2c6ea6a'
cups-systemd-socket.patch
guid.patch
cups-2.2.8-5325.patch)
sha256sums=('3968fc1d26fc48727508db1c1380e36c6694ab90177fd6920aec5f6cc73af9e4'
'SKIP'
'd87fa0f0b5ec677aae34668f260333db17ce303aa1a752cba5f8e72623d9acf9'
'57dfd072fd7ef0018c6b0a798367aac1abb5979060ff3f9df22d1048bb71c0d5'
'06173dfaea37bdd9b39b3e09aba98c34ae7112a2f521db45a688907d8848caa2'
'd4537526c1e075866ae22ad263da000fc2a592d36c26b79a459a1cfdade2bb2d'
'ff3eb0782af0405f5dafe89e04b1b4ea7a49afc5496860d724343bd04f375832'
'b8fc2e3bc603495f0278410350ea8f0161d9d83719feb64f573b63430cb4800b'
'23349c96f2f7aeb7d48e3bcd35a969f5d5ac8f55a032b0cfaa0a03d7e37ea9af'
'e5ad0e967c2ae9a9780211acb41980e4aa203df1dacff49d14d75a6ab6c8b8ed'
'c04627383d66f19b78e78f960d4d46577111ec9789b937ac4efba4cf369c921f')
'f909719e2595e016c320afa421cad74ccda285ac59b11749ddac58e707d4330a'
'd4537526c1e075866ae22ad263da000fc2a592d36c26b79a459a1cfdade2bb2d'
'b1daf250e16d34539149535c68a241f32223b1f34d142d0ee369fde019340de9')
validpgpkeys=('3737FD0D0E63B30172440D2DDBA3A7AB08D76223') # CUPS.org (CUPS.org PGP key) <security@cups.org>
validpgpkeys+=('45D083946E3035282B3CCA9AF434104235DA97EB') # "CUPS.org <security@cups.org>"
validpgpkeys+=('845464660B686AAB36540B6F999559A027815955') # "Michael R Sweet <michael.r.sweet@gmail.com>"
prepare() {
cd ${pkgbase}-${pkgver}
@ -50,14 +53,15 @@ prepare() {
patch -Np1 -i ${srcdir}/cups-1.6.2-statedir.patch
# bug fixes
# https://github.com/apple/cups/issues/5289
patch -Np1 -i ${srcdir}/auth-workaround-for-certain-web-browsers.patch
# make sure network is up when starting and notify systemd - FC
patch -Np1 -i ${srcdir}/cups-systemd-socket.patch
# FS#56818 - https://github.com/apple/cups/issues/5236
patch -Np1 -i ${srcdir}/guid.patch
# https://github.com/apple/cups/issues/5325
patch -Np1 -i ${srcdir}/cups-2.2.8-5325.patch
# set MaxLogSize to 0 to prevent using cups internal log rotation
sed -i -e '5i\ ' conf/cupsd.conf.in
sed -i -e '6i# Disable cups internal logging - use logrotate instead' conf/cupsd.conf.in
@ -106,7 +110,7 @@ depends=('gnutls' 'libtiff>=4.0.0' 'libpng>=1.5.7' 'krb5' 'avahi' 'libusb')
cd ${pkgbase}-${pkgver}
make BUILDROOT=${pkgdir} install-headers install-libs
# put this into the libs pkg to make other software find the libs(no pkg-config file included)
mkdir -p ${pkgdir}/usr/bin
mkdir -p ${pkgdir}/usr/bin
install -m755 ${srcdir}/${pkgbase}-${pkgver}/cups-config ${pkgdir}/usr/bin/cups-config
}
@ -122,7 +126,7 @@ backup=(etc/cups/cupsd.conf
etc/dbus-1/system.d/cups.conf
etc/logrotate.d/cups
etc/pam.d/cups)
depends=('acl' 'pam' "libcups>=${pkgver}" 'cups-filters' 'bc'
depends=('acl' 'pam' "libcups>=${pkgver}" 'cups-filters' 'bc'
'dbus' 'systemd' 'libpaper' 'hicolor-icon-theme')
optdepends=('xdg-utils: xdg .desktop file support'
'colord: for ICC color profile support')
@ -156,21 +160,21 @@ optdepends=('xdg-utils: xdg .desktop file support'
# install some more configuration files that will get filled by cupsd
touch ${pkgdir}/etc/cups/printers.conf
touch ${pkgdir}/etc/cups/classes.conf
touch ${pkgdir}/etc/cups/subscriptions.conf
touch ${pkgdir}/etc/cups/subscriptions.conf
chgrp -R 209 ${pkgdir}/etc/cups
# fix .desktop file
sed -i 's|^Exec=htmlview http://localhost:631/|Exec=xdg-open http://localhost:631/|g' ${pkgdir}/usr/share/applications/cups.desktop
# compress some driver files, adopted from Fedora
find ${pkgdir}/usr/share/cups/model -name "*.ppd" | xargs gzip -n9f
# remove client.conf man page
rm -f ${pkgdir}/usr/share/man/man5/client.conf.5
# comment out all conversion rules which use any of the removed filters that are now part of cups-filters
perl -p -i -e 's:^(.*\s+bannertops\s*)$:#\1:' $pkgdir/usr/share/cups/mime/mime.convs
# comment out unnecessary PageLogFormat entry
sed -i -e 's:PageLogFormat:#PageLogFormat:' $pkgdir/etc/cups/cupsd.conf*
}

View file

@ -1,59 +0,0 @@
From 4feb1fe2e5bb9f418f51f5f517f70b451159baa2 Mon Sep 17 00:00:00 2001
From: Michael R Sweet <michael.r.sweet@gmail.com>
Date: Mon, 16 Apr 2018 17:16:31 -0400
Subject: [PATCH] - Added a workaround for certain web browsers that do not
support multiple authentication schemes in a single response header (Issue
#5289)
---
scheduler/client.c | 22 +++++++++++++++++-----
scheduler/client.h | 8 +++++---
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/scheduler/client.c b/scheduler/client.c
index f388499dc..95c34877d 100644
--- a/scheduler/client.c
+++ b/scheduler/client.c
@@ -813,6 +814,18 @@ cupsdReadClient(cupsd_client_t *con) /* I - Client to read from */
if (status == HTTP_STATUS_OK)
{
+ /*
+ * Record whether the client is a web browser. "Mozilla" was the original
+ * and it seems that every web browser in existence now uses that as the
+ * prefix with additional information identifying *which* browser.
+ *
+ * Chrome (at least) has problems with multiple WWW-Authenticate values in
+ * a single header, so we only report Basic or Negotiate to web browsers and
+ * leave the multiple choices to the native CUPS client...
+ */
+
+ con->is_browser = !strncmp(httpGetField(con->http, HTTP_FIELD_USER_AGENT), "Mozilla/", 8);
+
if (httpGetField(con->http, HTTP_FIELD_ACCEPT_LANGUAGE)[0])
{
/*
@@ -2103,8 +2116,7 @@ cupsdSendHeader(
strlcpy(auth_str, "Negotiate", sizeof(auth_str));
}
- if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE &&
- !_cups_strcasecmp(httpGetHostname(con->http, NULL, 0), "localhost"))
+ if (con->best && auth_type != CUPSD_AUTH_NEGOTIATE && !con->is_browser && !_cups_strcasecmp(httpGetHostname(con->http, NULL, 0), "localhost"))
{
/*
* Add a "trc" (try root certification) parameter for local non-Kerberos
diff --git a/scheduler/client.h b/scheduler/client.h
index aaca8279a..fc7af5400 100644
--- a/scheduler/client.h
+++ b/scheduler/client.h
@@ -26,6 +27,7 @@ struct cupsd_client_s
struct timeval start; /* Request start time */
http_state_t operation; /* Request operation */
off_t bytes; /* Bytes transferred for this request */
+ int is_browser; /* Is the client a web browser? */
int type; /* AuthType for username */
char username[HTTP_MAX_VALUE],
/* Username from Authorization: line */
--
2.17.0

View file

@ -0,0 +1,64 @@
diff --git a/cups/ipp.c b/cups/ipp.c
index 9346b201f..d6e39d5d8 100644
--- a/cups/ipp.c
+++ b/cups/ipp.c
@@ -5101,16 +5101,19 @@ ippValidateAttribute(
break;
}
- if (*ptr < ' ' || *ptr == 0x7f)
- {
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
- return (0);
- }
- else if (*ptr)
- {
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
- return (0);
- }
+ if (*ptr)
+ {
+ if (*ptr < ' ' || *ptr == 0x7f)
+ {
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text);
+ return (0);
+ }
+ else
+ {
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text);
+ return (0);
+ }
+ }
if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1))
{
@@ -5163,16 +5166,19 @@ ippValidateAttribute(
break;
}
- if (*ptr < ' ' || *ptr == 0x7f)
- {
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
- return (0);
- }
- else if (*ptr)
+ if (*ptr)
{
- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
- return (0);
- }
+ if (*ptr < ' ' || *ptr == 0x7f)
+ {
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text);
+ return (0);
+ }
+ else
+ {
+ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text);
+ return (0);
+ }
+ }
if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1))
{

View file

@ -43,7 +43,7 @@ diff -up cups-2.0.2/scheduler/org.cups.cupsd.service.in.ustTJg cups-2.0.2/schedu
ExecStart=@sbindir@/cupsd -l
-Type=simple
+Type=notify
Restart=always
Restart=on-failure
[Install]