Skip to content
Snippets Groups Projects
Commit c7631a77 authored by Rocky Automation's avatar Rocky Automation :tv:
Browse files

import python3.11-3.11.9-2.el8_10

parent 949f4647
No related branches found
Tags imports/r8/python3.11-3.11.9-2.el8_10
No related merge requests found
e5feea809aad509f99943b68d44ac7c89eb943fbefb0f0ced5050675a6d1d16e 6146ef29ae002c4abb3e07316c079dde832739c187a57b35123cfacfb314df1d
85cd12e9cf1d6d5a45f17f7afe1cebe7ee628d3282281c492e86adf636defa3f SOURCES/Python-3.11.5.tar.xz 9b1e896523fc510691126c864406d9360a3d1e986acbda59cda57b5abda45b87 SOURCES/Python-3.11.9.tar.xz
fb28243ffeb9725b14b60586a9a123682a89604c025b7a9d4bcdeb67078203c6 SOURCES/pgp_keys.asc fb28243ffeb9725b14b60586a9a123682a89604c025b7a9d4bcdeb67078203c6 SOURCES/pgp_keys.asc
This diff is collapsed.
From 8b70605b594b3831331a9340ba764ff751871612 Mon Sep 17 00:00:00 2001 From 0181d677dd7fd11bc19a211b3eb735ac3ad3d7fb Mon Sep 17 00:00:00 2001
From: Petr Viktorin <encukou@gmail.com> From: Petr Viktorin <encukou@gmail.com>
Date: Mon, 6 Mar 2023 17:24:24 +0100 Date: Mon, 6 Mar 2023 17:24:24 +0100
Subject: [PATCH] CVE-2007-4559, PEP-706: Add filters for tarfile extraction Subject: [PATCH] CVE-2007-4559, PEP-706: Add filters for tarfile extraction
...@@ -9,11 +9,11 @@ variable and config file. ...@@ -9,11 +9,11 @@ variable and config file.
--- ---
Lib/tarfile.py | 42 +++++++++++++ Lib/tarfile.py | 42 +++++++++++++
Lib/test/test_shutil.py | 3 +- Lib/test/test_shutil.py | 3 +-
Lib/test/test_tarfile.py | 128 ++++++++++++++++++++++++++++++++++++++- Lib/test/test_tarfile.py | 127 ++++++++++++++++++++++++++++++++++++++-
3 files changed, 169 insertions(+), 4 deletions(-) 3 files changed, 168 insertions(+), 4 deletions(-)
diff --git a/Lib/tarfile.py b/Lib/tarfile.py diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 130b5e0..3b7d8d5 100755 index 612217b..dc59fc6 100755
--- a/Lib/tarfile.py --- a/Lib/tarfile.py
+++ b/Lib/tarfile.py +++ b/Lib/tarfile.py
@@ -72,6 +72,13 @@ __all__ = ["TarFile", "TarInfo", "is_tarfile", "TarError", "ReadError", @@ -72,6 +72,13 @@ __all__ = ["TarFile", "TarInfo", "is_tarfile", "TarError", "ReadError",
...@@ -30,7 +30,7 @@ index 130b5e0..3b7d8d5 100755 ...@@ -30,7 +30,7 @@ index 130b5e0..3b7d8d5 100755
#--------------------------------------------------------- #---------------------------------------------------------
# tar constants # tar constants
@@ -2211,6 +2218,41 @@ class TarFile(object): @@ -2219,6 +2226,41 @@ class TarFile(object):
if filter is None: if filter is None:
filter = self.extraction_filter filter = self.extraction_filter
if filter is None: if filter is None:
...@@ -73,10 +73,10 @@ index 130b5e0..3b7d8d5 100755 ...@@ -73,10 +73,10 @@ index 130b5e0..3b7d8d5 100755
if isinstance(filter, str): if isinstance(filter, str):
raise TypeError( raise TypeError(
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 9bf4145..f247b82 100644 index 6728d30..2338b63 100644
--- a/Lib/test/test_shutil.py --- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py
@@ -1665,7 +1665,8 @@ class TestArchives(BaseTest, unittest.TestCase): @@ -1774,7 +1774,8 @@ class TestArchives(BaseTest, unittest.TestCase):
def check_unpack_tarball(self, format): def check_unpack_tarball(self, format):
self.check_unpack_archive(format, filter='fully_trusted') self.check_unpack_archive(format, filter='fully_trusted')
self.check_unpack_archive(format, filter='data') self.check_unpack_archive(format, filter='data')
...@@ -87,10 +87,10 @@ index 9bf4145..f247b82 100644 ...@@ -87,10 +87,10 @@ index 9bf4145..f247b82 100644
def test_unpack_archive_tar(self): def test_unpack_archive_tar(self):
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index cdea033..4724285 100644 index 389da7b..5a43f9d 100644
--- a/Lib/test/test_tarfile.py --- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py
@@ -2,7 +2,7 @@ import sys @@ -3,7 +3,7 @@ import sys
import os import os
import io import io
from hashlib import sha256 from hashlib import sha256
...@@ -99,7 +99,7 @@ index cdea033..4724285 100644 ...@@ -99,7 +99,7 @@ index cdea033..4724285 100644
from random import Random from random import Random
import pathlib import pathlib
import shutil import shutil
@@ -2999,7 +2999,11 @@ class NoneInfoExtractTests(ReadTest): @@ -3049,7 +3049,11 @@ class NoneInfoExtractTests(ReadTest):
tar = tarfile.open(tarname, mode='r', encoding="iso8859-1") tar = tarfile.open(tarname, mode='r', encoding="iso8859-1")
cls.control_dir = pathlib.Path(TEMPDIR) / "extractall_ctrl" cls.control_dir = pathlib.Path(TEMPDIR) / "extractall_ctrl"
tar.errorlevel = 0 tar.errorlevel = 0
...@@ -112,7 +112,7 @@ index cdea033..4724285 100644 ...@@ -112,7 +112,7 @@ index cdea033..4724285 100644
tar.close() tar.close()
cls.control_paths = set( cls.control_paths = set(
p.relative_to(cls.control_dir) p.relative_to(cls.control_dir)
@@ -3674,7 +3678,8 @@ class TestExtractionFilters(unittest.TestCase): @@ -3868,7 +3872,8 @@ class TestExtractionFilters(unittest.TestCase):
"""Ensure the default filter does not warn (like in 3.12)""" """Ensure the default filter does not warn (like in 3.12)"""
with ArchiveMaker() as arc: with ArchiveMaker() as arc:
arc.add('foo') arc.add('foo')
...@@ -122,10 +122,10 @@ index cdea033..4724285 100644 ...@@ -122,10 +122,10 @@ index cdea033..4724285 100644
with self.check_context(arc.open(), None): with self.check_context(arc.open(), None):
self.expect_file('foo') self.expect_file('foo')
@@ -3844,6 +3849,123 @@ class TestExtractionFilters(unittest.TestCase): @@ -4037,6 +4042,122 @@ class TestExtractionFilters(unittest.TestCase):
with self.check_context(arc.open(errorlevel='boo!'), filtererror_filter):
self.expect_exception(TypeError) # errorlevel is not int self.expect_exception(TypeError) # errorlevel is not int
+ @contextmanager + @contextmanager
+ def rh_config_context(self, config_lines=None): + def rh_config_context(self, config_lines=None):
+ """Set up for testing various ways of overriding the default filter + """Set up for testing various ways of overriding the default filter
...@@ -242,10 +242,9 @@ index cdea033..4724285 100644 ...@@ -242,10 +242,9 @@ index cdea033..4724285 100644
+ ): + ):
+ self.check_trusted_default(tar, tempdir) + self.check_trusted_default(tar, tempdir)
+ +
+
def setUpModule(): class OverwriteTests(archiver_tests.OverwriteTests, unittest.TestCase):
os_helper.unlink(TEMPDIR) testdir = os.path.join(TEMPDIR, "testoverwrite")
os.makedirs(TEMPDIR)
-- --
2.41.0 2.44.0
From 670984c96eea60488c5355b4cf535c1ee3cf081a Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Wed, 24 Apr 2024 04:24:16 +0200
Subject: [PATCH] Fix xml tests
---
Lib/test/test_pyexpat.py | 3 +++
Lib/test/test_sax.py | 2 ++
Lib/test/test_xml_etree.py | 6 ++++++
3 files changed, 11 insertions(+)
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
index 44bd1de..5976fa0 100644
--- a/Lib/test/test_pyexpat.py
+++ b/Lib/test/test_pyexpat.py
@@ -3,6 +3,7 @@
import os
import platform
+import pyexpat
import sys
import sysconfig
import unittest
@@ -793,6 +794,8 @@ class ReparseDeferralTest(unittest.TestCase):
self.assertEqual(started, ['doc'])
+ @unittest.skipIf(pyexpat.version_info < (2, 6, 0),
+ "Reparse deferral not defined for libexpat < 2.6.0")
def test_reparse_deferral_disabled(self):
started = []
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
index 9b3014a..5960de1 100644
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -1240,6 +1240,8 @@ class ExpatReaderTest(XmlTestBase):
self.assertEqual(result.getvalue(), start + b"<doc></doc>")
+ @unittest.skipIf(pyexpat.version_info < (2, 6, 0),
+ "Reparse deferral not defined for libexpat < 2.6.0")
def test_flush_reparse_deferral_disabled(self):
result = BytesIO()
xmlgen = XMLGenerator(result)
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 8becafb..5e9b6b5 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -1424,9 +1424,13 @@ class XMLPullParserTest(unittest.TestCase):
self.assert_event_tags(parser, [('end', 'root')])
self.assertIsNone(parser.close())
+ @unittest.skipIf(pyexpat.version_info < (2, 6, 0),
+ "test not compatible with the latest expat security release")
def test_simple_xml_chunk_1(self):
self.test_simple_xml(chunk_size=1, flush=True)
+ @unittest.skipIf(pyexpat.version_info < (2, 6, 0),
+ "test not compatible with the latest expat security release")
def test_simple_xml_chunk_5(self):
self.test_simple_xml(chunk_size=5, flush=True)
@@ -1651,6 +1655,8 @@ class XMLPullParserTest(unittest.TestCase):
self.assert_event_tags(parser, [('end', 'doc')])
+ @unittest.skipIf(pyexpat.version_info < (2, 6, 0),
+ "Reparse deferral not defined for libexpat < 2.6.0")
def test_flush_reparse_deferral_disabled(self):
parser = ET.XMLPullParser(events=('start', 'end'))
--
2.44.0
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEz9yiRbEEPPKl+Xhl/+h0BBaL2EcFAmYNMEcACgkQ/+h0BBaL
2EeHhxAAuuIM9bl0dgAWOjbgRjCeXR8aFdfcI4dkO7bZrUy8eKbM+XCvPUUvloRJ
vzGkxYyTmI4kcNPOHfscUwH7AVVij8nGv7WeaXBUZGIXNwfHwvqOxvYvSsNNNFnr
70yJB7Df8/2s0XqFx3X1aWcnyMDerWKpfJ/VI/NPmCVxkYXGshuTTSFcCMTSFBQB
sNrIb5NWAsBF4R85uRQDlCg1AoyaKOdJNQkPo1Nrjol1ExJ+MHE7+E+QL9pQkUWG
SBISPUhJySBAegxolw6YR5dz1L4nukueQDJz3NizUeQGDvH7h1ImY8cypRi44U61
SUUHhBfmUBiC2dS/tTQawySULWcgbkV4GJ6cJZfDd95uffd4S/GDJCa2wCE2UTlA
XzQHwbcnIeoL064gX7ruBuFHJ6n/Oz7nZkFqbH2aqLTAWgLiUq31xH3HY734sL6X
zIJQRbcK1EM7cnNjKMVPlnHpAeKbsbHbU6yzWwZ7reIoyWlZ7vEGrfXO7Kmul93K
wVaWu0AiOY566ugekdDx4cKV+FQN6oppAN63yTfPJ2Ddcmxs4KNrtozw9OAgDTPE
GTPFD6V1CMuyQj/jOpAmbj+4bRD4Mx3u2PSittvrIeopxrXPsGGSZ5kdl62Xa2+A
DzKyYNXzcmxqS9lGdFb+OWCTyAIXxwZrdz1Q61g5xDvR9z/wZiI=
=Br9/
-----END PGP SIGNATURE-----
...@@ -17,9 +17,9 @@ LEVELS = (None, 1, 2) ...@@ -17,9 +17,9 @@ LEVELS = (None, 1, 2)
not_compiled = [ not_compiled = [
'/usr/bin/*', '/usr/bin/*',
'/usr/lib/rpm/redhat/*', '/usr/lib/rpm/redhat/*',
'*/test/bad_coding.py', '*/test/*/bad_coding.py',
'*/test/bad_coding2.py', '*/test/*/bad_coding2.py',
'*/test/badsyntax_*.py', '*/test/*/badsyntax_*.py',
'*/lib2to3/tests/data/bom.py', '*/lib2to3/tests/data/bom.py',
'*/lib2to3/tests/data/crlf.py', '*/lib2to3/tests/data/crlf.py',
'*/lib2to3/tests/data/different_encoding.py', '*/lib2to3/tests/data/different_encoding.py',
......
...@@ -16,11 +16,11 @@ URL: https://www.python.org/ ...@@ -16,11 +16,11 @@ URL: https://www.python.org/
# WARNING When rebasing to a new Python version, # WARNING When rebasing to a new Python version,
# remember to update the python3-docs package as well # remember to update the python3-docs package as well
%global general_version %{pybasever}.5 %global general_version %{pybasever}.9
#global prerel ... #global prerel ...
%global upstream_version %{general_version}%{?prerel} %global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}} Version: %{general_version}%{?prerel:~%{prerel}}
Release: 1%{?dist} Release: 2%{?dist}
License: Python License: Python
...@@ -63,7 +63,7 @@ License: Python ...@@ -63,7 +63,7 @@ License: Python
# If the rpmwheels condition is disabled, we use the bundled wheel packages # If the rpmwheels condition is disabled, we use the bundled wheel packages
# from Python with the versions below. # from Python with the versions below.
# This needs to be manually updated when we update Python. # This needs to be manually updated when we update Python.
%global pip_version 23.2.1 %global pip_version 24.0
%global setuptools_version 65.5.0 %global setuptools_version 65.5.0
# Expensive optimizations (mainly, profile-guided optimizations) # Expensive optimizations (mainly, profile-guided optimizations)
...@@ -371,6 +371,26 @@ Patch378: 00378-support-expat-2-4-5.patch ...@@ -371,6 +371,26 @@ Patch378: 00378-support-expat-2-4-5.patch
# - https://access.redhat.com/articles/7004769 # - https://access.redhat.com/articles/7004769
Patch397: 00397-tarfile-filter.patch Patch397: 00397-tarfile-filter.patch
# 00415 #
# [CVE-2023-27043] gh-102988: Reject malformed addresses in email.parseaddr() (#111116)
#
# Detect email address parsing errors and return empty tuple to
# indicate the parsing error (old API). Add an optional 'strict'
# parameter to getaddresses() and parseaddr() functions. Patch by
# Thomas Dwyer.
#
# Upstream PR: https://github.com/python/cpython/pull/111116
#
# Second patch implmenets the possibility to restore the old behavior via
# config file or environment variable.
Patch415: 00415-cve-2023-27043-gh-102988-reject-malformed-addresses-in-email-parseaddr-111116.patch
# 00422 #
# Fix the test suite for releases of expat < 2.6.0
# which backport the CVE-2023-52425 fix.
# Downstream only.
Patch422: 00422-fix-expat-tests.patch
# (New patches go here ^^^) # (New patches go here ^^^)
# #
# When adding new patches to "python" and "python3" in Fedora, EL, etc., # When adding new patches to "python" and "python3" in Fedora, EL, etc.,
...@@ -389,10 +409,10 @@ Patch397: 00397-tarfile-filter.patch ...@@ -389,10 +409,10 @@ Patch397: 00397-tarfile-filter.patch
# Descriptions, and metadata for subpackages # Descriptions, and metadata for subpackages
# ========================================== # ==========================================
# Require alternatives version that implements the --keep-foreign flag # Require alternatives version that implements the --keep-foreign flag and fixes rhbz#2203820
Requires: alternatives >= 1.19.1-1 Requires: alternatives >= 1.19.2-1
Requires(post): alternatives >= 1.19.1-1 Requires(post): alternatives >= 1.19.2-1
Requires(postun): alternatives >= 1.19.1-1 Requires(postun): alternatives >= 1.19.2-1
# When the user tries to `yum install python`, yum will list this package among # When the user tries to `yum install python`, yum will list this package among
# the possible alternatives # the possible alternatives
...@@ -540,8 +560,8 @@ Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} ...@@ -540,8 +560,8 @@ Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
Requires: (python-rpm-macros if rpm-build) Requires: (python-rpm-macros if rpm-build)
Requires: (python3-rpm-macros if rpm-build) Requires: (python3-rpm-macros if rpm-build)
# Require alternatives version that implements the --keep-foreign flag # Require alternatives version that implements the --keep-foreign flag and fixes rhbz#2203820
Requires(postun): alternatives >= 1.19.1-1 Requires(postun): alternatives >= 1.19.2-1
# python3.11 installs the alternatives master symlink to which we attach a slave # python3.11 installs the alternatives master symlink to which we attach a slave
Requires(post): %{pkgname} Requires(post): %{pkgname}
...@@ -594,8 +614,8 @@ Provides: idle = %{version}-%{release} ...@@ -594,8 +614,8 @@ Provides: idle = %{version}-%{release}
Provides: %{pkgname}-tools = %{version}-%{release} Provides: %{pkgname}-tools = %{version}-%{release}
Provides: %{pkgname}-tools%{?_isa} = %{version}-%{release} Provides: %{pkgname}-tools%{?_isa} = %{version}-%{release}
# Require alternatives version that implements the --keep-foreign flag # Require alternatives version that implements the --keep-foreign flag and fixes rhbz#2203820
Requires(postun): alternatives >= 1.19.1-1 Requires(postun): alternatives >= 1.19.2-1
# python3.11 installs the alternatives master symlink to which we attach a slave # python3.11 installs the alternatives master symlink to which we attach a slave
Requires(post): %{pkgname} Requires(post): %{pkgname}
...@@ -660,8 +680,8 @@ Requires: %{pkgname}-idle%{?_isa} = %{version}-%{release} ...@@ -660,8 +680,8 @@ Requires: %{pkgname}-idle%{?_isa} = %{version}-%{release}
%unversioned_obsoletes_of_python3_X_if_main debug %unversioned_obsoletes_of_python3_X_if_main debug
# Require alternatives version that implements the --keep-foreign flag # Require alternatives version that implements the --keep-foreign flag and fixes rhbz#2203820
Requires(postun): alternatives >= 1.19.1-1 Requires(postun): alternatives >= 1.19.2-1
# python3.11 installs the alternatives master symlink to which we attach a slave # python3.11 installs the alternatives master symlink to which we attach a slave
Requires(post): %{pkgname} Requires(post): %{pkgname}
...@@ -1009,6 +1029,10 @@ for tool in pygettext msgfmt; do ...@@ -1009,6 +1029,10 @@ for tool in pygettext msgfmt; do
ln -s ${tool}%{pybasever}.py %{buildroot}%{_bindir}/${tool}3.py ln -s ${tool}%{pybasever}.py %{buildroot}%{_bindir}/${tool}3.py
done done
# Install missing test data
# Fixed upstream: https://github.com/python/cpython/pull/112784
cp -rp Lib/test/regrtestdata/ %{buildroot}%{pylibdir}/test/
# Switch all shebangs to refer to the specific Python version. # Switch all shebangs to refer to the specific Python version.
# This currently only covers files matching ^[a-zA-Z0-9_]+\.py$, # This currently only covers files matching ^[a-zA-Z0-9_]+\.py$,
# so handle files named using other naming scheme separately. # so handle files named using other naming scheme separately.
...@@ -1299,7 +1323,7 @@ if [ $1 -eq 0 ]; then ...@@ -1299,7 +1323,7 @@ if [ $1 -eq 0 ]; then
fi fi
%post idle %post idle
alternatives --keep-foreign --add-slave python3 %{_bindir}/python3.11 \ alternatives --add-slave python3 %{_bindir}/python3.11 \
%{_bindir}/idle3 \ %{_bindir}/idle3 \
idle3 \ idle3 \
%{_bindir}/idle3.11 %{_bindir}/idle3.11
...@@ -1307,7 +1331,7 @@ alternatives --keep-foreign --add-slave python3 %{_bindir}/python3.11 \ ...@@ -1307,7 +1331,7 @@ alternatives --keep-foreign --add-slave python3 %{_bindir}/python3.11 \
%postun idle %postun idle
# Do this only during uninstall process (not during update) # Do this only during uninstall process (not during update)
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
alternatives --remove-slave python3 %{_bindir}/python3.11 \ alternatives --keep-foreign --remove-slave python3 %{_bindir}/python3.11 \
idle3 idle3
fi fi
...@@ -1821,6 +1845,24 @@ fi ...@@ -1821,6 +1845,24 @@ fi
# ====================================================== # ======================================================
%changelog %changelog
* Tue Jun 11 2024 Charalampos Stratakis <cstratak@redhat.com> - 3.11.9-2
- Enable importing of hash-based .pyc files under FIPS mode
Resolves: RHEL-40783
* Mon Apr 22 2024 Charalampos Stratakis <cstratak@redhat.com> - 3.11.9-1
- Rebase to 3.11.9
- Security fixes for CVE-2023-6597 and CVE-2024-0450
- Fix expat tests for the latest expat security release
Resolves: RHEL-33672, RHEL-33684
* Mon Jan 22 2024 Charalampos Stratakis <cstratak@redhat.com> - 3.11.7-1
- Rebase to 3.11.7
Resolves: RHEL-21915
* Tue Jan 09 2024 Lumír Balhar <lbalhar@redhat.com> - 3.11.5-2
- Security fix for CVE-2023-27043
Resolves: RHEL-7842
* Thu Sep 07 2023 Charalampos Stratakis <cstratak@redhat.com> - 3.11.5-1 * Thu Sep 07 2023 Charalampos Stratakis <cstratak@redhat.com> - 3.11.5-1
- Rebase to 3.11.5 - Rebase to 3.11.5
- Security fixes for CVE-2023-40217 and CVE-2023-41105 - Security fixes for CVE-2023-40217 and CVE-2023-41105
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment