Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-print/cups/files/, net-print/cups/
Date: Tue, 12 Jun 2018 08:17:40
Message-Id: 1528791314.48bc37017baa171ff6472b384f866cdf64a4edfa.polynomial-c@gentoo
1 commit: 48bc37017baa171ff6472b384f866cdf64a4edfa
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 12 08:15:14 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 12 08:15:14 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48bc3701
7
8 net-print/cups: Use official upstream fixes.
9
10 Closes: https://bugs.gentoo.org/657526
11 Package-Manager: Portage-2.3.40, Repoman-2.3.9
12
13 net-print/cups/cups-2.2.8-r1.ebuild | 2 +-
14 net-print/cups/cups-2.3_beta5-r1.ebuild | 2 +-
15 .../cups/files/cups-2.2.8-validation_fixes.patch | 79 ++++++++++++----------
16 .../files/cups-2.3_beta5-validation_fixes.patch | 69 +++++++++++++++++++
17 4 files changed, 115 insertions(+), 37 deletions(-)
18
19 diff --git a/net-print/cups/cups-2.2.8-r1.ebuild b/net-print/cups/cups-2.2.8-r1.ebuild
20 index d9adea70fc4..f382bb8f76a 100644
21 --- a/net-print/cups/cups-2.2.8-r1.ebuild
22 +++ b/net-print/cups/cups-2.2.8-r1.ebuild
23 @@ -79,7 +79,7 @@ PATCHES=(
24 "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
25 "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch"
26 "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch"
27 - "${FILESDIR}/${PN}-2.2.8-validation_fixes.patch" #657526
28 + "${FILESDIR}/${P}-validation_fixes.patch" #657526
29 )
30
31 MULTILIB_CHOST_TOOLS=(
32
33 diff --git a/net-print/cups/cups-2.3_beta5-r1.ebuild b/net-print/cups/cups-2.3_beta5-r1.ebuild
34 index ee8375c1474..f7c6d292fae 100644
35 --- a/net-print/cups/cups-2.3_beta5-r1.ebuild
36 +++ b/net-print/cups/cups-2.3_beta5-r1.ebuild
37 @@ -77,7 +77,7 @@ PATCHES=(
38 "${FILESDIR}/${PN}-1.4.4-nostrip.patch"
39 "${FILESDIR}/${PN}-2.0.2-rename-systemd-service-files.patch"
40 "${FILESDIR}/${PN}-2.0.1-xinetd-installation-fix.patch"
41 - "${FILESDIR}/${PN}-2.2.8-validation_fixes.patch" #657526
42 + "${FILESDIR}/${P}-validation_fixes.patch" #657526
43 )
44
45 MULTILIB_CHOST_TOOLS=(
46
47 diff --git a/net-print/cups/files/cups-2.2.8-validation_fixes.patch b/net-print/cups/files/cups-2.2.8-validation_fixes.patch
48 index ef87b6a81d8..4eee2274b94 100644
49 --- a/net-print/cups/files/cups-2.2.8-validation_fixes.patch
50 +++ b/net-print/cups/files/cups-2.2.8-validation_fixes.patch
51 @@ -1,30 +1,15 @@
52 -From 455c52a027ab3548953372a0b7bdb0008420e9ba Mon Sep 17 00:00:00 2001
53 -From: "Jan Alexander Steffens (heftig)" <jan.steffens@×××××.com>
54 -Date: Fri, 8 Jun 2018 22:29:50 +0200
55 -Subject: [PATCH] Fix validation rejecting all NAME and TEXT attrs
56 -
57 -When the UTF-8 validation loop finishes successfully, `*ptr` points at
58 -the `'\0'` at the end of the string. The code misinterpreted this as a
59 -control character (`*ptr < ' '`) and failed the validation.
60 -
61 -Fixes https://github.com/apple/cups/issues/5325
62 ----
63 - cups/ipp.c | 24 ++++++++++--------------
64 - 1 file changed, 10 insertions(+), 14 deletions(-)
65 +From 18545a5e7ab478b187a0d7136ee19496ae32fc9b Mon Sep 17 00:00:00 2001
66 +From: Michael R Sweet <michael.r.sweet@×××××.com>
67 +Date: Mon, 11 Jun 2018 09:37:55 -0400
68 +Subject: [PATCH] Fix regressions in ippValidateAttribute (Issue #5322, Issue
69 + #5330)
70
71 diff --git a/cups/ipp.c b/cups/ipp.c
72 -index 95d53cc44..204c71fcd 100644
73 +index 9346b201f..d6e39d5d8 100644
74 --- a/cups/ipp.c
75 +++ b/cups/ipp.c
76 -@@ -5030,15 +5030,13 @@ ippValidateAttribute(
77 - else if (*ptr & 0x80)
78 +@@ -5101,16 +5101,19 @@ ippValidateAttribute(
79 break;
80 - else if ((*ptr < ' ' && *ptr != '\n' && *ptr != '\r' && *ptr != '\t') || *ptr == 0x7f)
81 -- break;
82 -+ {
83 -+ 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);
84 -+ return (0);
85 -+ }
86 }
87
88 - if (*ptr < ' ' || *ptr == 0x7f)
89 @@ -33,19 +18,28 @@ index 95d53cc44..204c71fcd 100644
90 - return (0);
91 - }
92 - else if (*ptr)
93 -+ if (*ptr)
94 +- {
95 +- 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);
96 +- return (0);
97 +- }
98 ++ if (*ptr)
99 ++ {
100 ++ if (*ptr < ' ' || *ptr == 0x7f)
101 ++ {
102 ++ 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);
103 ++ return (0);
104 ++ }
105 ++ else
106 ++ {
107 ++ 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);
108 ++ return (0);
109 ++ }
110 ++ }
111 +
112 + if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1))
113 {
114 - 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);
115 - return (0);
116 -@@ -5088,15 +5086,13 @@ ippValidateAttribute(
117 - else if (*ptr & 0x80)
118 +@@ -5163,16 +5166,19 @@ ippValidateAttribute(
119 break;
120 - else if (*ptr < ' ' || *ptr == 0x7f)
121 -- break;
122 -+ {
123 -+ 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);
124 -+ return (0);
125 -+ }
126 }
127
128 - if (*ptr < ' ' || *ptr == 0x7f)
129 @@ -56,5 +50,20 @@ index 95d53cc44..204c71fcd 100644
130 - else if (*ptr)
131 + if (*ptr)
132 {
133 - 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);
134 - return (0);
135 +- 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);
136 +- return (0);
137 +- }
138 ++ if (*ptr < ' ' || *ptr == 0x7f)
139 ++ {
140 ++ 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);
141 ++ return (0);
142 ++ }
143 ++ else
144 ++ {
145 ++ 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);
146 ++ return (0);
147 ++ }
148 ++ }
149 +
150 + if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1))
151 + {
152
153 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
154 new file mode 100644
155 index 00000000000..29e2533eeb1
156 --- /dev/null
157 +++ b/net-print/cups/files/cups-2.3_beta5-validation_fixes.patch
158 @@ -0,0 +1,69 @@
159 +From 1d677f11f1e3353524d46c2842188eccfcdcd5a2 Mon Sep 17 00:00:00 2001
160 +From: Michael R Sweet <michael.r.sweet@×××××.com>
161 +Date: Mon, 11 Jun 2018 09:37:34 -0400
162 +Subject: [PATCH] Fix regressions in ippValidateAttribute (Issue #5322, Issue
163 + #5330)
164 +
165 +diff --git a/cups/ipp.c b/cups/ipp.c
166 +index 95d53cc44..325de02b9 100644
167 +--- a/cups/ipp.c
168 ++++ b/cups/ipp.c
169 +@@ -5033,16 +5033,19 @@ ippValidateAttribute(
170 + break;
171 + }
172 +
173 +- if (*ptr < ' ' || *ptr == 0x7f)
174 +- {
175 +- 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);
176 +- return (0);
177 +- }
178 +- else if (*ptr)
179 +- {
180 +- 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);
181 +- return (0);
182 +- }
183 ++ if (*ptr)
184 ++ {
185 ++ if (*ptr < ' ' || *ptr == 0x7f)
186 ++ {
187 ++ 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);
188 ++ return (0);
189 ++ }
190 ++ else
191 ++ {
192 ++ 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);
193 ++ return (0);
194 ++ }
195 ++ }
196 +
197 + if ((ptr - attr->values[i].string.text) > (IPP_MAX_TEXT - 1))
198 + {
199 +@@ -5091,16 +5094,19 @@ ippValidateAttribute(
200 + break;
201 + }
202 +
203 +- if (*ptr < ' ' || *ptr == 0x7f)
204 +- {
205 +- 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);
206 +- return (0);
207 +- }
208 +- else if (*ptr)
209 ++ if (*ptr)
210 + {
211 +- 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);
212 +- return (0);
213 +- }
214 ++ if (*ptr < ' ' || *ptr == 0x7f)
215 ++ {
216 ++ 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);
217 ++ return (0);
218 ++ }
219 ++ else
220 ++ {
221 ++ 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);
222 ++ return (0);
223 ++ }
224 ++ }
225 +
226 + if ((ptr - attr->values[i].string.text) > (IPP_MAX_NAME - 1))
227 + {