net-print/cups: Use official upstream fixes.
authorLars Wendler <polynomial-c@gentoo.org>
Tue, 12 Jun 2018 08:15:14 +0000 (10:15 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Tue, 12 Jun 2018 08:15:14 +0000 (10:15 +0200)
Closes: https://bugs.gentoo.org/657526
Package-Manager: Portage-2.3.40, Repoman-2.3.9

net-print/cups/cups-2.2.8-r1.ebuild
net-print/cups/cups-2.3_beta5-r1.ebuild
net-print/cups/files/cups-2.2.8-validation_fixes.patch
net-print/cups/files/cups-2.3_beta5-validation_fixes.patch [new file with mode: 0644]

index d9adea70fc405368f047ef0b35a23fb67c8cb027..f382bb8f76af4f3e3a4245661ebebc9b7e3de2f4 100644 (file)
@@ -79,7 +79,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
        "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch"
        "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch"
-       "${FILESDIR}/${PN}-2.2.8-validation_fixes.patch" #657526
+       "${FILESDIR}/${P}-validation_fixes.patch" #657526
 )
 
 MULTILIB_CHOST_TOOLS=(
index ee8375c1474a96a8baa6f5af190230dd9b839ba9..f7c6d292faec03c43e35282a7a6a311d21a8bd54 100644 (file)
@@ -77,7 +77,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
        "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch"
        "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch"
-       "${FILESDIR}/${PN}-2.2.8-validation_fixes.patch" #657526
+       "${FILESDIR}/${P}-validation_fixes.patch" #657526
 )
 
 MULTILIB_CHOST_TOOLS=(
index ef87b6a81d861e6b29eb1c29ff445b5f1d1be339..4eee2274b94b9d70e018b0e19a1e954bb98b2823 100644 (file)
@@ -1,30 +1,15 @@
-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(-)
+From 18545a5e7ab478b187a0d7136ee19496ae32fc9b Mon Sep 17 00:00:00 2001
+From: Michael R Sweet <michael.r.sweet@gmail.com>
+Date: Mon, 11 Jun 2018 09:37:55 -0400
+Subject: [PATCH] Fix regressions in ippValidateAttribute (Issue #5322, Issue
+ #5330)
 
 diff --git a/cups/ipp.c b/cups/ipp.c
-index 95d53cc44..204c71fcd 100644
+index 9346b201f..d6e39d5d8 100644
 --- a/cups/ipp.c
 +++ b/cups/ipp.c
-@@ -5030,15 +5030,13 @@ ippValidateAttribute(
-           else if (*ptr & 0x80)
+@@ -5101,16 +5101,19 @@ ippValidateAttribute(
              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)
@@ -33,19 +18,28 @@ index 95d53cc44..204c71fcd 100644
 -          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);
+-        }
++          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))
          {
-           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)
+@@ -5163,16 +5166,19 @@ ippValidateAttribute(
              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)
@@ -56,5 +50,20 @@ index 95d53cc44..204c71fcd 100644
 -        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);
+-          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))
+         {
diff --git a/net-print/cups/files/cups-2.3_beta5-validation_fixes.patch b/net-print/cups/files/cups-2.3_beta5-validation_fixes.patch
new file mode 100644 (file)
index 0000000..29e2533
--- /dev/null
@@ -0,0 +1,69 @@
+From 1d677f11f1e3353524d46c2842188eccfcdcd5a2 Mon Sep 17 00:00:00 2001
+From: Michael R Sweet <michael.r.sweet@gmail.com>
+Date: Mon, 11 Jun 2018 09:37:34 -0400
+Subject: [PATCH] Fix regressions in ippValidateAttribute (Issue #5322, Issue
+ #5330)
+
+diff --git a/cups/ipp.c b/cups/ipp.c
+index 95d53cc44..325de02b9 100644
+--- a/cups/ipp.c
++++ b/cups/ipp.c
+@@ -5033,16 +5033,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))
+         {
+@@ -5091,16 +5094,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))
+         {