diff options
author | Adrian Bunk <bunk@stusta.de> | 2019-11-04 21:10:47 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-05 10:37:12 +0000 |
commit | 8410fde8b9dadaae649e6569c31d89bbfef7bf37 (patch) | |
tree | 0204eec648140c98af9ba666e2320987402afa7e /meta/recipes-devtools | |
parent | 9ccdd97d18d83c796f80ec0dbe54b0c6a0fd7e7c (diff) | |
download | poky-8410fde8b9dadaae649e6569c31d89bbfef7bf37.tar.gz |
python3: Upgrade 3.7.4 -> 3.7.5
Backported patches removed.
(From OE-Core rev: 87f77ac60f57e6b3bfb2b3f3f5877b8d90cf22b8)
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch | 2 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-bpo-34155-Dont-parse-domains-containing-GH-13079.patch | 132 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-bpo-38243-xmlrpc.server-Escape-the-server_title-GH-1.patch | 86 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch | 2 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3_3.7.5.bb (renamed from meta/recipes-devtools/python/python3_3.7.4.bb) | 6 |
5 files changed, 4 insertions, 224 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch b/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch index 661f52d01f..ea75262c4f 100644 --- a/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch +++ b/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch | |||
@@ -70,7 +70,7 @@ index 6e81b2f..671a20e 100644 | |||
70 | 70 | ||
71 | Programs/python.o: $(srcdir)/Programs/python.c | 71 | Programs/python.o: $(srcdir)/Programs/python.c |
72 | @@ -856,7 +857,7 @@ regen-opcode: | 72 | @@ -856,7 +857,7 @@ regen-opcode: |
73 | Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h | 73 | Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o Parser/parsetok.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h |
74 | 74 | ||
75 | Python/getplatform.o: $(srcdir)/Python/getplatform.c | 75 | Python/getplatform.o: $(srcdir)/Python/getplatform.c |
76 | - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c | 76 | - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c |
diff --git a/meta/recipes-devtools/python/python3/0001-bpo-34155-Dont-parse-domains-containing-GH-13079.patch b/meta/recipes-devtools/python/python3/0001-bpo-34155-Dont-parse-domains-containing-GH-13079.patch deleted file mode 100644 index 319e7ed07e..0000000000 --- a/meta/recipes-devtools/python/python3/0001-bpo-34155-Dont-parse-domains-containing-GH-13079.patch +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
1 | From 90d56127ae15b1e452755e62c77dc475dedf7161 Mon Sep 17 00:00:00 2001 | ||
2 | From: jpic <jpic@users.noreply.github.com> | ||
3 | Date: Wed, 17 Jul 2019 23:54:25 +0200 | ||
4 | Subject: [PATCH] bpo-34155: Dont parse domains containing @ (GH-13079) | ||
5 | |||
6 | Before: | ||
7 | |||
8 | >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses | ||
9 | (Address(display_name='', username='a', domain='malicious.org'),) | ||
10 | |||
11 | >>> parseaddr('a@malicious.org@important.com') | ||
12 | ('', 'a@malicious.org') | ||
13 | |||
14 | After: | ||
15 | |||
16 | >>> email.message_from_string('From: a@malicious.org@important.com', policy=email.policy.default)['from'].addresses | ||
17 | (Address(display_name='', username='', domain=''),) | ||
18 | |||
19 | >>> parseaddr('a@malicious.org@important.com') | ||
20 | ('', 'a@') | ||
21 | |||
22 | https://bugs.python.org/issue34155 | ||
23 | |||
24 | Upstream-Status: Backport [https://github.com/python/cpython/commit/8cb65d1381b027f0b09ee36bfed7f35bb4dec9a9] | ||
25 | |||
26 | CVE: CVE-2019-16056 | ||
27 | |||
28 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
29 | --- | ||
30 | Lib/email/_header_value_parser.py | 2 ++ | ||
31 | Lib/email/_parseaddr.py | 11 ++++++++++- | ||
32 | Lib/test/test_email/test__header_value_parser.py | 10 ++++++++++ | ||
33 | Lib/test/test_email/test_email.py | 14 ++++++++++++++ | ||
34 | .../2019-05-04-13-33-37.bpo-34155.MJll68.rst | 1 + | ||
35 | 5 files changed, 37 insertions(+), 1 deletion(-) | ||
36 | create mode 100644 Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst | ||
37 | |||
38 | diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py | ||
39 | index fc00b4a098..bbc026ec71 100644 | ||
40 | --- a/Lib/email/_header_value_parser.py | ||
41 | +++ b/Lib/email/_header_value_parser.py | ||
42 | @@ -1582,6 +1582,8 @@ def get_domain(value): | ||
43 | token, value = get_dot_atom(value) | ||
44 | except errors.HeaderParseError: | ||
45 | token, value = get_atom(value) | ||
46 | + if value and value[0] == '@': | ||
47 | + raise errors.HeaderParseError('Invalid Domain') | ||
48 | if leader is not None: | ||
49 | token[:0] = [leader] | ||
50 | domain.append(token) | ||
51 | diff --git a/Lib/email/_parseaddr.py b/Lib/email/_parseaddr.py | ||
52 | index cdfa3729ad..41ff6f8c00 100644 | ||
53 | --- a/Lib/email/_parseaddr.py | ||
54 | +++ b/Lib/email/_parseaddr.py | ||
55 | @@ -379,7 +379,12 @@ class AddrlistClass: | ||
56 | aslist.append('@') | ||
57 | self.pos += 1 | ||
58 | self.gotonext() | ||
59 | - return EMPTYSTRING.join(aslist) + self.getdomain() | ||
60 | + domain = self.getdomain() | ||
61 | + if not domain: | ||
62 | + # Invalid domain, return an empty address instead of returning a | ||
63 | + # local part to denote failed parsing. | ||
64 | + return EMPTYSTRING | ||
65 | + return EMPTYSTRING.join(aslist) + domain | ||
66 | |||
67 | def getdomain(self): | ||
68 | """Get the complete domain name from an address.""" | ||
69 | @@ -394,6 +399,10 @@ class AddrlistClass: | ||
70 | elif self.field[self.pos] == '.': | ||
71 | self.pos += 1 | ||
72 | sdlist.append('.') | ||
73 | + elif self.field[self.pos] == '@': | ||
74 | + # bpo-34155: Don't parse domains with two `@` like | ||
75 | + # `a@malicious.org@important.com`. | ||
76 | + return EMPTYSTRING | ||
77 | elif self.field[self.pos] in self.atomends: | ||
78 | break | ||
79 | else: | ||
80 | diff --git a/Lib/test/test_email/test__header_value_parser.py b/Lib/test/test_email/test__header_value_parser.py | ||
81 | index 693487bc96..7dc4de1b7b 100644 | ||
82 | --- a/Lib/test/test_email/test__header_value_parser.py | ||
83 | +++ b/Lib/test/test_email/test__header_value_parser.py | ||
84 | @@ -1438,6 +1438,16 @@ class TestParser(TestParserMixin, TestEmailBase): | ||
85 | self.assertEqual(addr_spec.domain, 'example.com') | ||
86 | self.assertEqual(addr_spec.addr_spec, 'star.a.star@example.com') | ||
87 | |||
88 | + def test_get_addr_spec_multiple_domains(self): | ||
89 | + with self.assertRaises(errors.HeaderParseError): | ||
90 | + parser.get_addr_spec('star@a.star@example.com') | ||
91 | + | ||
92 | + with self.assertRaises(errors.HeaderParseError): | ||
93 | + parser.get_addr_spec('star@a@example.com') | ||
94 | + | ||
95 | + with self.assertRaises(errors.HeaderParseError): | ||
96 | + parser.get_addr_spec('star@172.17.0.1@example.com') | ||
97 | + | ||
98 | # get_obs_route | ||
99 | |||
100 | def test_get_obs_route_simple(self): | ||
101 | diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py | ||
102 | index c29cc56203..aa775881c5 100644 | ||
103 | --- a/Lib/test/test_email/test_email.py | ||
104 | +++ b/Lib/test/test_email/test_email.py | ||
105 | @@ -3041,6 +3041,20 @@ class TestMiscellaneous(TestEmailBase): | ||
106 | self.assertEqual(utils.parseaddr('<>'), ('', '')) | ||
107 | self.assertEqual(utils.formataddr(utils.parseaddr('<>')), '') | ||
108 | |||
109 | + def test_parseaddr_multiple_domains(self): | ||
110 | + self.assertEqual( | ||
111 | + utils.parseaddr('a@b@c'), | ||
112 | + ('', '') | ||
113 | + ) | ||
114 | + self.assertEqual( | ||
115 | + utils.parseaddr('a@b.c@c'), | ||
116 | + ('', '') | ||
117 | + ) | ||
118 | + self.assertEqual( | ||
119 | + utils.parseaddr('a@172.17.0.1@c'), | ||
120 | + ('', '') | ||
121 | + ) | ||
122 | + | ||
123 | def test_noquote_dump(self): | ||
124 | self.assertEqual( | ||
125 | utils.formataddr(('A Silly Person', 'person@dom.ain')), | ||
126 | diff --git a/Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst b/Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst | ||
127 | new file mode 100644 | ||
128 | index 0000000000..50292e29ed | ||
129 | --- /dev/null | ||
130 | +++ b/Misc/NEWS.d/next/Security/2019-05-04-13-33-37.bpo-34155.MJll68.rst | ||
131 | @@ -0,0 +1 @@ | ||
132 | +Fix parsing of invalid email addresses with more than one ``@`` (e.g. a@b@c.com.) to not return the part before 2nd ``@`` as valid email address. Patch by maxking & jpic. | ||
diff --git a/meta/recipes-devtools/python/python3/0001-bpo-38243-xmlrpc.server-Escape-the-server_title-GH-1.patch b/meta/recipes-devtools/python/python3/0001-bpo-38243-xmlrpc.server-Escape-the-server_title-GH-1.patch deleted file mode 100644 index 1a4c932070..0000000000 --- a/meta/recipes-devtools/python/python3/0001-bpo-38243-xmlrpc.server-Escape-the-server_title-GH-1.patch +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | From c25abd43e8877b4a7098f79eaacb248710731c2b Mon Sep 17 00:00:00 2001 | ||
2 | From: Dong-hee Na <donghee.na92@gmail.com> | ||
3 | Date: Sat, 28 Sep 2019 04:59:37 +0900 | ||
4 | Subject: [PATCH] bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) | ||
5 | |||
6 | Escape the server title of xmlrpc.server.DocXMLRPCServer | ||
7 | when rendering the document page as HTML. | ||
8 | |||
9 | CVE: CVE-2019-16935 | ||
10 | |||
11 | Upstream-Status: Backport [https://github.com/python/cpython/commit/e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa] | ||
12 | |||
13 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
14 | --- | ||
15 | Lib/test/test_docxmlrpc.py | 16 ++++++++++++++++ | ||
16 | Lib/xmlrpc/server.py | 3 ++- | ||
17 | .../2019-09-25-13-21-09.bpo-38243.1pfz24.rst | 3 +++ | ||
18 | 3 files changed, 21 insertions(+), 1 deletion(-) | ||
19 | create mode 100644 Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst | ||
20 | |||
21 | diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py | ||
22 | index f077f05f5b..38215659b6 100644 | ||
23 | --- a/Lib/test/test_docxmlrpc.py | ||
24 | +++ b/Lib/test/test_docxmlrpc.py | ||
25 | @@ -1,5 +1,6 @@ | ||
26 | from xmlrpc.server import DocXMLRPCServer | ||
27 | import http.client | ||
28 | +import re | ||
29 | import sys | ||
30 | import threading | ||
31 | from test import support | ||
32 | @@ -193,6 +194,21 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase): | ||
33 | b'method_annotation</strong></a>(x: bytes)</dt></dl>'), | ||
34 | response.read()) | ||
35 | |||
36 | + def test_server_title_escape(self): | ||
37 | + # bpo-38243: Ensure that the server title and documentation | ||
38 | + # are escaped for HTML. | ||
39 | + self.serv.set_server_title('test_title<script>') | ||
40 | + self.serv.set_server_documentation('test_documentation<script>') | ||
41 | + self.assertEqual('test_title<script>', self.serv.server_title) | ||
42 | + self.assertEqual('test_documentation<script>', | ||
43 | + self.serv.server_documentation) | ||
44 | + | ||
45 | + generated = self.serv.generate_html_documentation() | ||
46 | + title = re.search(r'<title>(.+?)</title>', generated).group() | ||
47 | + documentation = re.search(r'<p><tt>(.+?)</tt></p>', generated).group() | ||
48 | + self.assertEqual('<title>Python: test_title<script></title>', title) | ||
49 | + self.assertEqual('<p><tt>test_documentation<script></tt></p>', documentation) | ||
50 | + | ||
51 | |||
52 | if __name__ == '__main__': | ||
53 | unittest.main() | ||
54 | diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py | ||
55 | index f1c467eb1b..32aba4df4c 100644 | ||
56 | --- a/Lib/xmlrpc/server.py | ||
57 | +++ b/Lib/xmlrpc/server.py | ||
58 | @@ -108,6 +108,7 @@ from xmlrpc.client import Fault, dumps, loads, gzip_encode, gzip_decode | ||
59 | from http.server import BaseHTTPRequestHandler | ||
60 | from functools import partial | ||
61 | from inspect import signature | ||
62 | +import html | ||
63 | import http.server | ||
64 | import socketserver | ||
65 | import sys | ||
66 | @@ -894,7 +895,7 @@ class XMLRPCDocGenerator: | ||
67 | methods | ||
68 | ) | ||
69 | |||
70 | - return documenter.page(self.server_title, documentation) | ||
71 | + return documenter.page(html.escape(self.server_title), documentation) | ||
72 | |||
73 | class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): | ||
74 | """XML-RPC and documentation request handler class. | ||
75 | diff --git a/Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst b/Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst | ||
76 | new file mode 100644 | ||
77 | index 0000000000..98d7be1295 | ||
78 | --- /dev/null | ||
79 | +++ b/Misc/NEWS.d/next/Security/2019-09-25-13-21-09.bpo-38243.1pfz24.rst | ||
80 | @@ -0,0 +1,3 @@ | ||
81 | +Escape the server title of :class:`xmlrpc.server.DocXMLRPCServer` | ||
82 | +when rendering the document page as HTML. | ||
83 | +(Contributed by Dong-hee Na in :issue:`38243`.) | ||
84 | -- | ||
85 | 2.17.1 | ||
86 | |||
diff --git a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch index 5735954628..a0ea897f4e 100644 --- a/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch +++ b/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch | |||
@@ -63,7 +63,7 @@ index a7de901..4a3681f 100644 | |||
63 | + case $cc_basename in | 63 | + case $cc_basename in |
64 | *clang*) | 64 | *clang*) |
65 | AC_SUBST(LLVM_AR) | 65 | AC_SUBST(LLVM_AR) |
66 | AC_PATH_TARGET_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path}) | 66 | AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path}) |
67 | @@ -1426,7 +1427,7 @@ then | 67 | @@ -1426,7 +1427,7 @@ then |
68 | fi | 68 | fi |
69 | fi | 69 | fi |
diff --git a/meta/recipes-devtools/python/python3_3.7.4.bb b/meta/recipes-devtools/python/python3_3.7.5.bb index dd61c0aa45..0338fa4ba8 100644 --- a/meta/recipes-devtools/python/python3_3.7.4.bb +++ b/meta/recipes-devtools/python/python3_3.7.5.bb | |||
@@ -29,8 +29,6 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ | |||
29 | file://0001-Use-FLAG_REF-always-for-interned-strings.patch \ | 29 | file://0001-Use-FLAG_REF-always-for-interned-strings.patch \ |
30 | file://0001-test_locale.py-correct-the-test-output-format.patch \ | 30 | file://0001-test_locale.py-correct-the-test-output-format.patch \ |
31 | file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \ | 31 | file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \ |
32 | file://0001-bpo-34155-Dont-parse-domains-containing-GH-13079.patch \ | ||
33 | file://0001-bpo-38243-xmlrpc.server-Escape-the-server_title-GH-1.patch \ | ||
34 | " | 32 | " |
35 | 33 | ||
36 | SRC_URI_append_class-native = " \ | 34 | SRC_URI_append_class-native = " \ |
@@ -41,8 +39,8 @@ SRC_URI_append_class-nativesdk = " \ | |||
41 | file://0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch \ | 39 | file://0001-main.c-if-OEPYTHON3HOME-is-set-use-instead-of-PYTHON.patch \ |
42 | " | 40 | " |
43 | 41 | ||
44 | SRC_URI[md5sum] = "d33e4aae66097051c2eca45ee3604803" | 42 | SRC_URI[md5sum] = "08ed8030b1183107c48f2092e79a87e2" |
45 | SRC_URI[sha256sum] = "fb799134b868199930b75f26678f18932214042639cd52b16da7fd134cd9b13f" | 43 | SRC_URI[sha256sum] = "e85a76ea9f3d6c485ec1780fca4e500725a4a7bbc63c78ebc44170de9b619d94" |
46 | 44 | ||
47 | # exclude pre-releases for both python 2.x and 3.x | 45 | # exclude pre-releases for both python 2.x and 3.x |
48 | UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar" | 46 | UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar" |