Skip to content

Commit

Permalink
Update python36 to version 3.6.12 / rev 4 via SR 852415
Browse files Browse the repository at this point in the history
https://build.opensuse.org/request/show/852415
by user mcepl + dimstar_suse
- Add CVE-2020-27619-no-eval-http-content.patch fixing
  CVE-2020-27619 (bsc#1178009), where Lib/test/multibytecodec_support
  calls eval() on content retrieved via HTTP.
- Add patch sphnix-update-removed-function.patch to no longer call
  a now removed function (gh#python/cpython#13236). As
  a consequence, no longer pin Sphinx version.
- Pin Sphinx version to fix doc subpackage
- Change setuptools and pip version numbers according to new wheels
- Add ignore_pip_deprec_warn.patch to switch of persistently
  failing test.
- Replace bundled wheels for pip and setuptools with the updated ones
  (bsc#1176262 CVE-2019-20916).
- Handful of changes to make python36 compatible with SLE15 and SLE12
  (jsc#ECO-2799, jsc#SLE-13738)
- Rebase bpo23395-PyErr_SetInterrupt-signal.patch
- Fix build with RP
  • Loading branch information
mcepl authored and bmwiedemann committed Dec 2, 2020
1 parent 4086a13 commit c38825c
Show file tree
Hide file tree
Showing 6 changed files with 840 additions and 3 deletions.
Binary file modified packages/p/python36/.files
Binary file not shown.
718 changes: 718 additions & 0 deletions packages/p/python36/.rev

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions packages/p/python36/CVE-2020-27619-no-eval-http-content.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
From 7577b2d21ed82ad3aa5f60b7f1258760de0b2ad8 Mon Sep 17 00:00:00 2001
From: Serhiy Storchaka <storchaka@gmail.com>
Date: Tue, 6 Oct 2020 15:14:51 +0300
Subject: [PATCH] bpo-41944: No longer call eval() on content received via HTTP
in the CJK codec tests (GH-22566) (cherry picked from commit
2ef5caa58febc8968e670e39e3d37cf8eef3cab8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
---
Lib/test/multibytecodec_support.py | 22 +++++++------------
.../2020-10-05-17-43-46.bpo-41944.rf1dYb.rst | 1 +
2 files changed, 9 insertions(+), 14 deletions(-)
create mode 100644 Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst

--- a/Lib/test/multibytecodec_support.py
+++ b/Lib/test/multibytecodec_support.py
@@ -300,29 +300,23 @@ class TestBase_Mapping(unittest.TestCase
self._test_mapping_file_plain()

def _test_mapping_file_plain(self):
- unichrs = lambda s: ''.join(map(chr, map(eval, s.split('+'))))
+ def unichrs(s):
+ return ''.join(chr(int(x, 16)) for x in s.split('+'))
+
urt_wa = {}

with self.open_mapping_file() as f:
for line in f:
if not line:
break
- data = line.split('#')[0].strip().split()
+ data = line.split('#')[0].split()
if len(data) != 2:
continue

- csetval = eval(data[0])
- if csetval <= 0x7F:
- csetch = bytes([csetval & 0xff])
- elif csetval >= 0x1000000:
- csetch = bytes([(csetval >> 24), ((csetval >> 16) & 0xff),
- ((csetval >> 8) & 0xff), (csetval & 0xff)])
- elif csetval >= 0x10000:
- csetch = bytes([(csetval >> 16), ((csetval >> 8) & 0xff),
- (csetval & 0xff)])
- elif csetval >= 0x100:
- csetch = bytes([(csetval >> 8), (csetval & 0xff)])
- else:
+ if data[0][:2] != '0x':
+ self.fail(f"Invalid line: {line!r}")
+ csetch = bytes.fromhex(data[0][2:])
+ if len(csetch) == 1 and 0x80 <= csetch[0]:
continue

unich = unichrs(data[1])
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2020-10-05-17-43-46.bpo-41944.rf1dYb.rst
@@ -0,0 +1 @@
+Tests for CJK codecs no longer call ``eval()`` on content received via HTTP.
35 changes: 33 additions & 2 deletions packages/p/python36/python36.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-------------------------------------------------------------------
Tue Dec 1 17:20:14 UTC 2020 - Matej Cepl <mcepl@suse.com>

- Add CVE-2020-27619-no-eval-http-content.patch fixing
CVE-2020-27619 (bsc#1178009), where Lib/test/multibytecodec_support
calls eval() on content retrieved via HTTP.

-------------------------------------------------------------------
Tue Dec 1 05:37:07 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>

- Add patch sphnix-update-removed-function.patch to no longer call
a now removed function (gh#python/cpython#13236). As
a consequence, no longer pin Sphinx version.

-------------------------------------------------------------------
Fri Nov 27 15:59:09 UTC 2020 - Markéta Machová <mmachova@suse.com>

Expand Down Expand Up @@ -86,6 +100,8 @@ Thu Aug 20 08:17:16 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
* bpo40784-Fix-sqlite3-deterministic-test.patch
* bsc1167501-invalid-alignment.patch
* python3-imp-returntype.patch
- Working around missing python-packaging dependency in
python-Sphinx (bsc#1174571) is not necessary anymore.

-------------------------------------------------------------------
Wed Aug 19 12:46:41 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
Expand Down Expand Up @@ -140,7 +156,20 @@ Fri Jul 17 09:03:17 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
Fri Jul 17 08:53:33 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

- Update to 3.6.11:
* Include more security fixes (CVE-2019-18348, bsc#1155094)
- bpo-39073: Disallow CR or LF in email.headerregistry. Address
arguments to guard against header injection attacks.
- bpo-38576 (bsc#1155094): Disallow control characters in
hostnames in http.client, addressing CVE-2019-18348. Such
potentially malicious header injection URLs now cause
a InvalidURL to be raised.
- bpo-39503: CVE-2020-8492: The AbstractBasicAuthHandler class
of the urllib.request module uses an inefficient regular
expression which can be exploited by an attacker to cause
a denial of service. Fix the regex to prevent the
catastrophic backtracking. Vulnerability reported by Ben
Caller and Matt Schwager.
- bpo-39401: Avoid unsafe load of
api-ms-win-core-path-l1-1-0.dll at startup on Windows 7.
- Remove merged patch CVE-2020-8492-urllib-ReDoS.patch

-------------------------------------------------------------------
Expand Down Expand Up @@ -238,7 +267,9 @@ Thu Dec 19 16:42:56 CET 2019 - Matej Cepl <mcepl@suse.com>
max_line_length is not long enough to include the required
markup and any values in the message. Patch by Paul Ganssle
- Remove patches included in the upstream tarball:
- CVE-2019-16935-xmlrpc-doc-server_title.patch
- CVE-2019-16935-xmlrpc-doc-server_title.patch (and also
bpo37614-race_test_docxmlrpc_srv_setup.patch, which was
resolving bsc#1174701).
- CVE-2019-16056-email-parse-addr.patch
- Move idle subpackage build from python3-base to python3 (bsc#1159622).
appstream-glib required for packaging introduces considerable
Expand Down
9 changes: 8 additions & 1 deletion packages/p/python36/python36.spec
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ Patch38: faulthandler_stack_overflow_on_GCC10.patch
# PATCH-FIX-UPSTREAM ignore_pip_deprec_warn.patch mcepl@suse.com
# Ignore deprecation warning for old version of pip
Patch39: ignore_pip_deprec_warn.patch
# PATCH-FIX-UPSTREAM stop calling removed Sphinx function gh#python/cpython#13236
Patch40: sphnix-update-removed-function.patch
# PATCH-FIX-UPSTREAM CVE-2020-27619-no-eval-http-content.patch bsc#1178009 mcepl@suse.com
# No longer call eval() on content received via HTTP in the CJK codec tests
Patch41: CVE-2020-27619-no-eval-http-content.patch

BuildRequires: automake
BuildRequires: fdupes
Expand All @@ -190,7 +195,7 @@ BuildRequires: pkgconfig(libtirpc)
%if %{with doc}
# Here we just run sphinx and we can use generic one, we don't need
# the flavor variant
BuildRequires: python3-Sphinx < 3
BuildRequires: python3-Sphinx
%endif
%if %{with general}
# required for idle3 (.desktop and .appdata.xml files)
Expand Down Expand Up @@ -434,6 +439,8 @@ other applications.
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1

# drop Autoconf version requirement
sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac
Expand Down
23 changes: 23 additions & 0 deletions packages/p/python36/sphnix-update-removed-function.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From 960bb883769e5c64a63b014590d75654db87ffb0 Mon Sep 17 00:00:00 2001
From: Pablo Galindo <Pablogsal@gmail.com>
Date: Fri, 10 May 2019 22:58:17 +0100
Subject: [PATCH] Fix sphinx deprecation warning about env.note_versionchange()
(GH-13236)

---
Doc/tools/extensions/pyspecific.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: Python-3.6.12/Doc/tools/extensions/pyspecific.py
===================================================================
--- Python-3.6.12.orig/Doc/tools/extensions/pyspecific.py
+++ Python-3.6.12/Doc/tools/extensions/pyspecific.py
@@ -231,7 +231,7 @@ class DeprecatedRemoved(Directive):
translatable=False)
node.append(para)
env = self.state.document.settings.env
- env.note_versionchange('deprecated', version[0], node, self.lineno)
+ env.get_domain('changeset').note_changeset(node)
return [node] + messages


0 comments on commit c38825c

Please sign in to comment.