diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2018-06-09 16:57:58 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-06-10 08:58:04 +0200 |
commit | 548843b225f281a8d0583e3bf1ee77ac57d648a3 (patch) | |
tree | e913c5ec936caf9ec4bbe2218aed24a5583b76c5 /source | |
parent | 8f0b1c57c99036007acd8a798ee81d938df67b98 (diff) | |
download | current-548843b225f281a8d0583e3bf1ee77ac57d648a3.tar.gz current-548843b225f281a8d0583e3bf1ee77ac57d648a3.tar.xz |
Sat Jun 9 16:57:58 UTC 201820180609165758
ap/cups-2.2.8-x86_64-2.txz: Rebuilt.
Applied upstream patch to fix high CPU usage in some situations.
Diffstat (limited to 'source')
-rw-r--r-- | source/ap/cups/455c52a027ab3548953372a0b7bdb0008420e9ba.patch | 61 | ||||
-rwxr-xr-x | source/ap/cups/cups.SlackBuild | 5 |
2 files changed, 65 insertions, 1 deletions
diff --git a/source/ap/cups/455c52a027ab3548953372a0b7bdb0008420e9ba.patch b/source/ap/cups/455c52a027ab3548953372a0b7bdb0008420e9ba.patch new file mode 100644 index 000000000..7f60ed254 --- /dev/null +++ b/source/ap/cups/455c52a027ab3548953372a0b7bdb0008420e9ba.patch @@ -0,0 +1,61 @@ +From 455c52a027ab3548953372a0b7bdb0008420e9ba Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> +Date: Fri, 8 Jun 2018 22:29:50 +0200 +Subject: [PATCH] Fix validation rejecting all NAME and TEXT attrs + +When the UTF-8 validation loop finishes successfully, `*ptr` points at +the `'\0'` at the end of the string. The code misinterpreted this as a +control character (`*ptr < ' '`) and failed the validation. + +Fixes https://github.com/apple/cups/issues/5325 +--- + cups/ipp.c | 24 ++++++++++-------------- + 1 file changed, 10 insertions(+), 14 deletions(-) + +diff --git a/cups/ipp.c b/cups/ipp.c +index 95d53cc44..204c71fcd 100644 +--- a/cups/ipp.c ++++ b/cups/ipp.c +@@ -5030,15 +5030,13 @@ ippValidateAttribute( + else if (*ptr & 0x80) + break; + else if ((*ptr < ' ' && *ptr != '\n' && *ptr != '\r' && *ptr != '\t') || *ptr == 0x7f) +- break; ++ { ++ 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); ++ } + } + +- 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) ++ 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); +@@ -5088,15 +5086,13 @@ ippValidateAttribute( + else if (*ptr & 0x80) + break; + else if (*ptr < ' ' || *ptr == 0x7f) +- break; ++ { ++ 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); ++ } + } + +- 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); + diff --git a/source/ap/cups/cups.SlackBuild b/source/ap/cups/cups.SlackBuild index fe8fd16c3..44cd7c674 100755 --- a/source/ap/cups/cups.SlackBuild +++ b/source/ap/cups/cups.SlackBuild @@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=cups VERSION=${VERSION:-$(echo $PKGNAM-*-source.tar.?z | cut -f 2 -d -)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -81,6 +81,9 @@ cd cups-$VERSION || exit 1 sed -i.orig -e 's#$exec_prefix/lib/cups#$libdir/cups#g' configure +# Upstream patch to fix high CPU usage: +zcat $CWD/455c52a027ab3548953372a0b7bdb0008420e9ba.patch.gz | patch -p1 --verbose || exit 1 + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ |