2006-12-19 00:17:38 +01:00
#
2011-02-17 18:32:10 +01:00
# spec file for package python
2006-12-19 00:17:38 +01:00
#
2023-01-19 09:45:16 +01:00
# Copyright (c) 2023 SUSE LLC
2006-12-19 00:17:38 +01:00
#
2008-08-08 02:47:35 +02:00
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2018-09-27 16:11:14 +02:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2006-12-19 00:17:38 +01:00
#
2021-11-02 20:29:32 +01:00
2006-12-19 00:17:38 +01:00
Name : python
2020-04-23 11:28:38 +02:00
Version : 2.7.18
2011-12-08 14:04:48 +01:00
Release : 0
Summary : Python Interpreter
2013-07-08 15:12:23 +02:00
License : Python-2.0
2006-12-19 00:17:38 +01:00
Group : Development/Languages/Python
2023-04-30 20:18:35 +02:00
URL : https://www.python.org/
2012-04-17 16:57:13 +02:00
%define tarversion %{version}
2011-12-08 14:04:48 +01:00
%define tarname Python-%{tarversion}
2023-04-30 20:18:35 +02:00
Source0 : https://www.python.org/ftp/python/%{version} /%{tarname} .tar.xz
2010-09-03 17:55:49 +02:00
Source1 : README.SUSE
2015-09-14 17:36:31 +02:00
Source8 : sle_tls_checks_policy.py
2006-12-19 00:17:38 +01:00
#Source11: testfiles.tar.bz2
2019-12-11 17:37:24 +01:00
Source50 : idle.appdata.xml
Source51 : idle.desktop
2007-07-27 15:45:45 +02:00
# issues with copyrighted Unicode testing files
2021-09-25 23:16:13 +02:00
# For Patch 66
Source66 : recursion.tar
2011-09-16 18:22:41 +02:00
2011-08-24 15:28:09 +02:00
# !!!!!!!!!!!!!!
# do not add or edit patches here. please edit python-base.spec
# instead and run pre_checkin.sh
# !!!!!!!!!!!!!!
# COMMON-PATCH-BEGIN
2010-09-03 17:55:49 +02:00
Patch1 : python-2.7-dirs.patch
2011-08-24 15:28:09 +02:00
Patch2 : python-distutils-rpm-8.patch
2013-06-03 17:40:08 +02:00
Patch3 : python-2.7.5-multilib.patch
2010-09-03 17:55:49 +02:00
Patch4 : python-2.5.1-sqlite.patch
2013-05-09 18:15:40 +02:00
Patch5 : python-2.7.4-canonicalize2.patch
2011-08-24 15:28:09 +02:00
Patch7 : python-2.6-gettext-plurals.patch
Patch8 : python-2.6b3-curses-panel.patch
2011-12-08 14:04:48 +01:00
Patch10 : sparc_longdouble.patch
2011-08-24 15:28:09 +02:00
Patch13 : python-2.7.2-fix_date_time_compiler.patch
2019-12-03 12:26:41 +01:00
Patch17 : remove-static-libpython.patch
2012-08-06 18:21:50 +02:00
# PATCH-FEATURE-OPENSUSE python-bundle-lang.patch bnc#617751 dimstar@opensuse.org -- gettext: when looking in default_localedir also check in locale-bundle.
Patch20 : python-bundle-lang.patch
2014-12-22 17:49:53 +01:00
# PATCH-FIX-UPSTREAM Fix argument passing in libffi for aarch64
Patch22 : python-2.7-libffi-aarch64.patch
2019-12-03 12:26:41 +01:00
Patch24 : python-bsddb6.patch
2015-02-25 17:42:06 +01:00
# PATCH-FIX-UPSTREAM accept directory-based CA paths as well
Patch33 : python-2.7.9-ssl_ca_path.patch
2022-11-22 21:56:11 +01:00
# PATCH-FEATURE-SLE disable SSL verification-by-default in http clients
Patch34 : python-2.7.9-sles-disable-verification-by-default.patch
2018-05-22 10:06:13 +02:00
# PATCH-FIX-UPSTREAM do not use non-ASCII filename in test_ssl.py
Patch35 : do-not-use-non-ascii-in-test_ssl.patch
2017-03-24 18:13:29 +01:00
# PATCH-FIX-UPSTREAM bmwiedemann@suse.de -- allow python packages to build reproducibly
Patch38 : reproducible.patch
2018-02-02 13:44:43 +01:00
# bypass boo#1078485 random failing tests
Patch40 : python-skip_random_failing_tests.patch
2018-02-20 14:42:29 +01:00
# PATCH-FIX-UPSTREAM sorted tar https://github.com/python/cpython/pull/2263
Patch41 : python-sorted_tar.patch
2018-10-29 16:14:27 +01:00
# https://github.com/python/cpython/pull/9624 (https://bugs.python.org/issue34834)
Patch47 : openssl-111-middlebox-compat.patch
# PATCH-FIX-SUSE python default SSLContext doesn't contain OP_CIPHER_SERVER_PREFERENCE
Patch48 : openssl-111-ssl_options.patch
2019-01-20 02:08:59 +01:00
# PATCH-FIX-UPSTREAM CVE-2019-5010-null-defer-x509-cert-DOS.patch bnc#1122191 mcepl@suse.com
2019-11-12 15:04:49 +01:00
# gh#python/cpython#11569
2019-01-20 02:08:59 +01:00
# Fix segfault in ssl's cert parser
Patch49 : CVE-2019-5010-null-defer-x509-cert-DOS.patch
2019-04-09 00:40:36 +02:00
# PATCH-FIX-UPSTREAM bpo36160-init-sysconfig_vars.patch gh#python/cpython#12131 mcepl@suse.com
# Initialize sysconfig variables in test_site.
Patch50 : bpo36160-init-sysconfig_vars.patch
2019-11-12 15:04:49 +01:00
# PATCH-FIX-UPSTREAM CVE-2017-18207.patch gh#python/cpython#4437 psimons@suse.com
# Add check for channels of wav file in Lib/wave.py
Patch51 : CVE-2017-18207.patch
# PATCH-FIX-UPSTREAM gh#python/cpython#12341
2019-09-25 17:35:20 +02:00
Patch55 : bpo36302-sort-module-sources.patch
2019-11-12 15:04:49 +01:00
# Fix installation in /usr/local (boo#1071941), adapted from Fedora
# https://src.fedoraproject.org/rpms/python3/blob/master/f/00251-change-user-install-location.patch
# Set values of prefix and exec_prefix in distutils install command
# to /usr/local if executable is /usr/bin/python* and RPM build
# is not detected to make pip and distutils install into separate location
Patch56 : adapted-from-F00251-change-user-install-location.patch
2020-01-28 15:39:17 +01:00
# Switch couple of tests failing on acient SLE-12
Patch57 : python-2.7.17-switch-off-failing-SSL-tests.patch
2020-02-08 23:22:43 +01:00
# PATCH-FIX-UPSTREAM CVE-2020-8492-urllib-ReDoS.patch bsc#1162367 mcepl@suse.com
# Fixes Python urrlib allowed an HTTP server to conduct Regular
# Expression Denial of Service (ReDoS)
Patch58 : CVE-2020-8492-urllib-ReDoS.patch
# PATCH-FIX-UPSTREAM CVE-2019-9674-zip-bomb.patch bsc#1162825 mcepl@suse.com
# Improve documentation warning against the possible zip bombs
Patch59 : CVE-2019-9674-zip-bomb.patch
2020-05-30 14:23:29 +02:00
# PATCH-FIX-UPSTREAM configure_PYTHON_FOR_REGEN.patch bsc#1078326 mcepl@suse.com
# PYTHON_FOR_REGEN value is set very weird upstream
Patch60 : configure_PYTHON_FOR_REGEN.patch
2021-01-31 19:01:03 +01:00
# PATCH-FIX-SLE CVE-2021-3177-buf_ovrfl_PyCArg_repr.patch bsc#1181126 mcepl@suse.com
# buffer overflow in PyCArg_repr in _ctypes/callproc.c, which may lead to remote code execution
Patch61 : CVE-2021-3177-buf_ovrfl_PyCArg_repr.patch
2021-02-26 23:02:43 +01:00
# PATCH-FIX-UPSTREAM CVE-2021-23336-only-amp-as-query-sep.patch bsc#[0-9]+ mcepl@suse.com
# this patch makes things totally awesome
Patch62 : CVE-2021-23336-only-amp-as-query-sep.patch
2021-08-26 23:32:53 +02:00
# PATCH-FIX-UPSTREAM CVE-2021-3737-fix-HTTP-client-infinite-line-reading-after-a-HTTP-100-Continue.patch boo#1189241 gh#python/cpython#25916
Patch63 : CVE-2021-3737-fix-HTTP-client-infinite-line-reading-after-a-HTTP-100-Continue.patch
2021-08-26 08:56:34 +02:00
# PATCH-FIX-UPSTREAM CVE-2021-3733-fix-ReDoS-in-request.patch boo#1189287 gh#python/cpython#24391
Patch64 : CVE-2021-3733-fix-ReDoS-in-request.patch
# PATCH-FIX-UPSTREAM sphinx-update-removed-function.patch bpo#35293 gh#python/cpython#22198 -- fix doc build
Patch65 : sphinx-update-removed-function.patch
2021-09-25 23:16:13 +02:00
# PATCH-FIX-UPSTREAM CVE-2019-20907_tarfile-inf-loop.patch bsc#1174091 mcepl@suse.com
# avoid possible infinite loop in specifically crafted tarball (CVE-2019-20907)
# REQUIRES SOURCE 66
Patch66 : CVE-2019-20907_tarfile-inf-loop.patch
# PATCH-FIX-UPSTREAM CVE-2020-26116-httplib-header-injection.patch bsc#1177211
# Fixes httplib to disallow control characters in method to avoid header
# injection
Patch67 : CVE-2020-26116-httplib-header-injection.patch
2022-02-06 08:47:48 +01:00
# PATCH-FIX-UPSTREAM CVE-2021-4189-ftplib-trust-PASV-resp.patch bsc#1194146 mcepl@suse.com
# Make ftplib not trust the PASV response. (gh#python/cpython#24838)
Patch68 : CVE-2021-4189-ftplib-trust-PASV-resp.patch
2022-02-09 17:55:07 +01:00
# PATCH-FIX-UPSTREAM CVE-2022-0391-urllib_parse-newline-parsing.patch bsc#1195396 mcepl@suse.com
# whole long discussion is on bpo#43882
# fix for santization URLs containing ASCII newline and tabs in urllib.parse
Patch69 : CVE-2022-0391-urllib_parse-newline-parsing.patch
2022-06-09 18:47:44 +02:00
# PATCH-FIX-UPSTREAM CVE-2015-20107-mailcap-unsafe-filenames.patch bsc#1198511 mcepl@suse.com
# avoid the command injection in the mailcap module.
Patch70 : CVE-2015-20107-mailcap-unsafe-filenames.patch
2022-09-07 06:48:27 +02:00
# PATCH-FIX-UPSTREAM CVE-2021-28861 bsc#1202624
# Coerce // to / in Lib/BaseHTTPServer.py
Patch71 : CVE-2021-28861-double-slash-path.patch
2022-09-15 09:46:07 +02:00
Patch72 : bpo34990-2038-problem-compileall.patch
2022-11-09 20:07:01 +01:00
# PATCH-FIX-UPSTREAM CVE-2022-45061-DoS-by-IDNA-decode.patch bsc#1205244 mcepl@suse.com
# Avoid DoS by decoding IDNA for too long domain names
Patch73 : CVE-2022-45061-DoS-by-IDNA-decode.patch
2023-01-19 09:45:16 +01:00
# PATCH-FIX-UPSTREAM skip_unverified_test.patch mcepl@suse.com
# switching verification off on the old SLE doesn't work
Patch74 : skip_unverified_test.patch
2023-03-01 23:01:21 +01:00
# PATCH-FIX-UPSTREAM CVE-2023-24329-blank-URL-bypass.patch bsc#1208471 mcepl@suse.com
# blocklist bypass via the urllib.parse component when supplying
# a URL that starts with blank characters
Patch75 : CVE-2023-24329-blank-URL-bypass.patch
2023-05-24 22:56:16 +02:00
# PATCH-FIX-OPENSUSE PygmentsBridge-trime_doctest_flags.patch mcepl@suse.com
# Build documentation even without PygmentsBridge.trim_doctest_flags
Patch76 : PygmentsBridge-trime_doctest_flags.patch
2011-08-24 15:28:09 +02:00
# COMMON-PATCH-END
2011-12-08 14:04:48 +01:00
BuildRequires : automake
BuildRequires : db-devel
BuildRequires : fdupes
BuildRequires : gdbm-devel
BuildRequires : gmp-devel
BuildRequires : libbz2-devel
2023-05-29 20:52:32 +02:00
# This is NOT switching off NIS support on SLE < 15,
# support for NIS used to be in the glibc itself
2023-01-27 17:14:53 +01:00
%if 0%{?suse_version} >= 1500 && 0%{?suse_version} < 1599
2017-08-21 14:25:25 +02:00
BuildRequires : libnsl-devel
2023-01-27 17:14:53 +01:00
%endif
%if 0%{?suse_version} >= 1500
2021-12-06 16:16:14 +01:00
BuildRequires : libopenssl-1_1-devel
2022-02-18 11:52:31 +01:00
%else
BuildRequires : libopenssl-devel
%endif
2011-12-08 14:04:48 +01:00
BuildRequires : ncurses-devel
BuildRequires : readline-devel
BuildRequires : sqlite-devel
BuildRequires : tk-devel
2013-06-03 17:40:08 +02:00
BuildRequires : xz
2015-05-21 15:52:43 +02:00
BuildRequires : pkgconfig(x11)
2019-12-11 17:37:24 +01:00
# for %%{_datadir}/application and %%{_datadir}/mime/packages
BuildRequires : filesystem
BuildRequires : update-desktop-files
# for %%{_datadir}/icons/hicolor directories
BuildRequires : hicolor-icon-theme
2011-12-08 14:31:32 +01:00
%define python_version %(echo %{tarversion} | head -c 3)
2006-12-19 00:17:38 +01:00
%define idle_name idle
2012-08-13 17:34:55 +02:00
Requires : python-base = %{version}
2015-09-14 17:36:31 +02:00
%if %{suse_version} == 1315 && !0%{?is_opensuse}
Recommends: python-strict-tls-check
%endif
2008-10-13 16:53:57 +02:00
Provides : %{name} = %{python_version}
2016-12-02 16:37:55 +01:00
Provides : python2 = %{version}
2019-12-19 10:19:58 +01:00
# To make older versions of this package to conflict with
# shared-python-startup I need a symbol to conflict with
2019-12-11 17:37:24 +01:00
Provides : python2_split_startup
2011-12-08 14:04:48 +01:00
Obsoletes : python-elementtree
Obsoletes : python-nothreads
Obsoletes : python-sqlite
Obsoletes : python21
# bug437293
%ifarch ppc64
Obsoletes : python-64bit
%endif
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2006-12-19 00:17:38 +01:00
%description
Python is an interpreted, object-oriented programming language, and is
often compared to Tcl, Perl, Scheme, or Java. You can find an overview
of Python in the documentation and tutorials included in the python-doc
(HTML) or python-doc-pdf (PDF) packages.
If you want to install third party modules using distutils, you need to
install python-devel package.
%package idle
Summary : An Integrated Development Environment for Python
Group : Development/Languages/Python
2012-08-13 17:34:55 +02:00
Requires : python-base = %{version}
2011-12-08 14:04:48 +01:00
Requires : python-tk
2016-12-02 16:37:55 +01:00
Provides : python2-idle = %{version}
2006-12-19 00:17:38 +01:00
%description idle
IDLE is a Tkinter based integrated development environment for Python.
It features a multi-window text editor with multiple undo, Python
colorizing, and many other things, as well as a Python shell window and
a debugger.
%package demo
Summary : Python Demonstration Scripts
Group : Development/Languages/Python
2012-08-13 17:34:55 +02:00
Requires : python-base = %{version}
2011-12-08 14:04:48 +01:00
Provides : pyth_dmo
Obsoletes : pyth_dmo
2016-12-02 16:37:55 +01:00
Provides : python2-demo = %{version}
2006-12-19 00:17:38 +01:00
%description demo
Various demonstrations of what you can do with Python and a number of
programs that are useful for building or extending Python.
%package tk
2011-12-08 14:04:48 +01:00
Summary : TkInter - Python Tk Interface
Group : Development/Libraries/Python
2012-08-13 17:34:55 +02:00
Requires : python-base = %{version}
2011-12-08 14:04:48 +01:00
Provides : pyth_tk
Provides : pyth_tkl
Provides : python-tkinter
Provides : python_tkinter_lib
2007-05-25 00:42:28 +02:00
#%ifarch %ix86
#Provides: _tkinter.so
#%endif
2011-12-08 14:04:48 +01:00
Obsoletes : pyth_tk
Obsoletes : pyth_tkl
Obsoletes : python-tkinter
2016-12-02 16:37:55 +01:00
Provides : python2-tk = %{version}
2006-12-19 00:17:38 +01:00
%description tk
2019-08-18 09:24:48 +02:00
Python interface to Tk. Tk is the GUI toolkit that comes with Tcl.
2006-12-19 00:17:38 +01:00
%package curses
2011-12-08 14:04:48 +01:00
Summary : Python Interface to the (N)Curses Library
Group : Development/Libraries/Python
2012-08-13 17:34:55 +02:00
Requires : python-base = %{version}
2006-12-19 00:17:38 +01:00
Obsoletes : pyth_cur
Provides : pyth_cur
2016-12-02 16:37:55 +01:00
Provides : python2-curses = %{version}
2006-12-19 00:17:38 +01:00
%description curses
An easy to use interface to the (n)curses CUI library. CUI stands for
Console User Interface.
%package gdbm
2011-12-08 14:04:48 +01:00
Summary : Python Interface to the GDBM Library
Group : Development/Libraries/Python
2012-08-13 17:34:55 +02:00
Requires : python-base = %{version}
2006-12-19 00:17:38 +01:00
Obsoletes : pygdmod
Provides : pygdmod
2016-12-02 16:37:55 +01:00
Provides : python2-gdbm = %{version}
2020-01-02 11:35:17 +01:00
# Compat to allow BR on python_module dbm and have it properly
# pull in gdbm on py2 and dbm on py3
Provides : python-dbm = %{version}
Provides : python2-dbm = %{version}
2006-12-19 00:17:38 +01:00
%description gdbm
An easy to use interface for GDBM databases. GDBM is the GNU
implementation of the standard Unix DBM databases.
2015-09-14 17:36:31 +02:00
%if %{suse_version} == 1315 && !0%{?is_opensuse}
%package strict-tls-check
Summary : Enable secure verification of TLS certificates
Group : Development/Libraries/Python
Requires : %{name} = %{version}
Supplements: %{name}
%description strict-tls-check
When this package is present, Python performs strict verification of
TLS certificates, including hostname check, by default. This is
the preferred secure setting.
It is distributed as a separate package, because this behavior
can cause verification errors in improperly written legacy scripts
that rely on earlier non-verification behavior.
%endif
2006-12-19 00:17:38 +01:00
%prep
%setup -q -n %{tarname}
2011-08-24 15:28:09 +02:00
# COMMON-PREP-BEGIN
2010-09-03 17:55:49 +02:00
%patch1 -p1
%patch2 -p1
2013-06-03 12:24:54 +02:00
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch7 -p1
%patch8 -p1
2011-05-04 16:18:55 +02:00
%patch10 -p1
2013-06-03 12:24:54 +02:00
%patch13 -p1
%patch17 -p1
2012-08-06 18:21:50 +02:00
%patch20 -p1
2013-06-03 17:40:08 +02:00
%patch22 -p1
2013-08-16 13:26:52 +02:00
%patch24 -p1
2015-02-25 17:42:06 +01:00
%patch33 -p1
2022-11-22 21:56:11 +01:00
%if %{suse_version} < 1500 && !0%{?is_opensuse}
%patch34 -p1
%endif
2015-09-10 16:02:25 +02:00
%patch35 -p1
2017-03-24 18:13:29 +01:00
%patch38 -p1
2018-02-02 13:44:43 +01:00
%ifarch ppc ppc64 ppc64le
%patch40 -p1
%endif
2018-02-20 14:42:29 +01:00
%patch41 -p1
2020-01-28 15:39:17 +01:00
%if %{suse_version} >= 1500
2018-10-29 16:14:27 +01:00
%patch47 -p1
%patch48 -p1
2020-01-28 15:39:17 +01:00
%else
%patch57 -p1
%endif
2019-01-20 02:08:59 +01:00
%patch49 -p1
2019-04-09 00:40:36 +02:00
%patch50 -p1
2019-11-12 15:04:49 +01:00
%patch51 -p1
2019-09-25 17:35:20 +02:00
%patch55 -p1
2019-11-12 15:04:49 +01:00
%patch56 -p1
2020-02-08 23:22:43 +01:00
%patch58 -p1
%patch59 -p1
2020-05-30 14:23:29 +02:00
%patch60 -p1
2021-01-31 19:01:03 +01:00
%patch61 -p1
2021-02-26 23:02:43 +01:00
%patch62 -p1
2021-08-10 06:45:07 +02:00
%patch63 -p1
Accepting request 911251 from home:fusionfuture:branches:devel:languages:python:Factory
- Add bpo43075-fix-ReDoS-in-request.patch which fixes ReDoS in
request (bpo#43075, boo#1189287).
- Add missing security announcement to
bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch.
old: devel:languages:python:Factory/python
new: home:fusionfuture:branches:devel:languages:python:Factory/python rev None
Index: bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch
===================================================================
--- bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch (revision 296)
+++ bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch (revision 3)
@@ -19,3 +19,8 @@
self.status = status
self.reason = reason.strip()
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2021-05-05-17-37-04.bpo-44022.bS3XJ9.rst
+@@ -0,0 +1,2 @@
++mod:`http.client` now avoids infinitely reading potential HTTP headers after a
++``100 Continue`` status response from the server.
Index: python-base.changes
===================================================================
--- python-base.changes (revision 296)
+++ python-base.changes (revision 3)
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Tue Aug 10 12:39:28 UTC 2021 - Fusion Future <qydwhotmail@gmail.com>
+
+- Add bpo43075-fix-ReDoS-in-request.patch which fixes ReDoS in
+ request (bpo#43075, boo#1189287).
+- Add missing security announcement to
+ bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch.
+
+-------------------------------------------------------------------
Mon Aug 9 15:16:15 UTC 2021 - Fusion Future <qydwhotmail@gmail.com>
- Add bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch
Index: python-base.spec
===================================================================
--- python-base.spec (revision 296)
+++ python-base.spec (revision 3)
@@ -105,6 +105,8 @@
Patch62: CVE-2021-23336-only-amp-as-query-sep.patch
# PATCH-FIX-UPSTREAM bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch boo#1189241 gh#python/cpython#25916
Patch63: bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch
+# PATCH-FIX-UPSTREAM bpo43075-fix-ReDoS-in-request.patch boo#1189287 gh#python/cpython#24391
+Patch64: bpo43075-fix-ReDoS-in-request.patch
# COMMON-PATCH-END
%define python_version %(echo %{tarversion} | head -c 3)
BuildRequires: automake
@@ -233,6 +235,7 @@
%patch61 -p1
%patch62 -p1
%patch63 -p1
+%patch64 -p1
# drop Autoconf version requirement
sed -i 's/^version_required/dnl version_required/' configure.ac
Index: python-doc.changes
===================================================================
--- python-doc.changes (revision 296)
+++ python-doc.changes (revision 3)
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Tue Aug 10 12:39:28 UTC 2021 - Fusion Future <qydwhotmail@gmail.com>
+
+- Add bpo43075-fix-ReDoS-in-request.patch which fixes ReDoS in
+ request (bpo#43075, boo#1189287).
+- Add missing security announcement to
+ bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch.
+
+-------------------------------------------------------------------
Mon Aug 9 15:16:15 UTC 2021 - Fusion Future <qydwhotmail@gmail.com>
- Add bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch
Index: python-doc.spec
===================================================================
--- python-doc.spec (revision 296)
+++ python-doc.spec (revision 3)
@@ -107,6 +107,8 @@
Patch62: CVE-2021-23336-only-amp-as-query-sep.patch
# PATCH-FIX-UPSTREAM bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch boo#1189241 gh#python/cpython#25916
Patch63: bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch
+# PATCH-FIX-UPSTREAM bpo43075-fix-ReDoS-in-request.patch boo#1189287 gh#python/cpython#24391
+Patch64: bpo43075-fix-ReDoS-in-request.patch
# COMMON-PATCH-END
Provides: pyth_doc
Provides: pyth_ps
@@ -177,6 +179,7 @@
%patch61 -p1
%patch62 -p1
%patch63 -p1
+%patch64 -p1
# drop Autoconf version requirement
sed -i 's/^version_required/dnl version_required/' configure.ac
Index: python.changes
===================================================================
--- python.changes (revision 296)
+++ python.changes (revision 3)
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Tue Aug 10 12:39:28 UTC 2021 - Fusion Future <qydwhotmail@gmail.com>
+
+- Add bpo43075-fix-ReDoS-in-request.patch which fixes ReDoS in
+ request (bpo#43075, boo#1189287).
+- Add missing security announcement to
+ bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch.
+
+-------------------------------------------------------------------
Mon Aug 9 15:16:15 UTC 2021 - Fusion Future <qydwhotmail@gmail.com>
- Add bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch
Index: python.spec
===================================================================
--- python.spec (revision 296)
+++ python.spec (revision 3)
@@ -107,6 +107,8 @@
Patch62: CVE-2021-23336-only-amp-as-query-sep.patch
# PATCH-FIX-UPSTREAM bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch boo#1189241 gh#python/cpython#25916
Patch63: bpo44022-fix-http-client-infinite-line-reading-after-a-HTTP-100-Continue.patch
+# PATCH-FIX-UPSTREAM bpo43075-fix-ReDoS-in-request.patch boo#1189287 gh#python/cpython#24391
+Patch64: bpo43075-fix-ReDoS-in-request.patch
# COMMON-PATCH-END
BuildRequires: automake
BuildRequires: db-devel
@@ -291,6 +293,7 @@
%patch61 -p1
%patch62 -p1
%patch63 -p1
+%patch64 -p1
# drop Autoconf version requirement
sed -i 's/^version_required/dnl version_required/' configure.ac
Index: bpo43075-fix-ReDoS-in-request.patch
===================================================================
--- bpo43075-fix-ReDoS-in-request.patch (added)
+++ bpo43075-fix-ReDoS-in-request.patch (revision 3)
@@ -0,0 +1,15 @@
+--- a/Lib/urllib2.py
++++ b/Lib/urllib2.py
+@@ -856,7 +856,7 @@ class AbstractBasicAuthHandler:
+
+ # allow for double- and single-quoted realm values
+ # (single quotes are a violation of the RFC, but appear in the wild)
+- rx = re.compile('(?:[^,]*,)*[ \t]*([^ \t]+)[ \t]+'
++ rx = re.compile('(?:[^,]*,)*[ \t]*([^ \t,]+)[ \t]+'
+ 'realm=(["\']?)([^"\']*)\\2', re.I)
+
+ # XXX could pre-emptively send auth info already accepted (RFC 2617,
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2021-01-31-05-28-14.bpo-43075.DoAXqO.rst
+@@ -0,0 +1 @@
++Fix Regular Expression Denial of Service (ReDoS) vulnerability in :class:`urllib.request.AbstractBasicAuthHandler`. The ReDoS-vulnerable regex has quadratic worst-case complexity and it allows cause a denial of service when identifying crafted invalid RFCs. This ReDoS issue is on the client side and needs remote attackers to control the HTTP server.
OBS-URL: https://build.opensuse.org/request/show/911251
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python?expand=0&rev=297
2021-08-10 14:55:29 +02:00
%patch64 -p1
2021-08-26 08:56:34 +02:00
%patch65 -p1
2021-09-25 23:16:13 +02:00
%patch66 -p1
%patch67 -p1
2022-02-06 08:47:48 +01:00
%patch68 -p1
2022-02-09 17:55:07 +01:00
%patch69 -p1
2022-06-09 18:47:44 +02:00
%patch70 -p1
2022-09-07 06:48:27 +02:00
%patch71 -p1
2022-09-15 09:46:07 +02:00
%patch72 -p1
2022-11-09 20:07:01 +01:00
%patch73 -p1
2023-01-19 09:45:16 +01:00
%if 0%{?sle_version} && 0%{?sle_version} < 150000
%patch74 -p1
%endif
2023-03-01 23:01:21 +01:00
%patch75 -p1
2023-05-24 22:56:16 +02:00
%patch76 -p1
2021-09-25 23:16:13 +02:00
# For patch 66
cp -v %{SOURCE66} Lib/test/recursion.tar
2011-05-24 17:33:04 +02:00
# drop Autoconf version requirement
2013-05-09 18:15:40 +02:00
sed -i 's/^version_required/dnl version_required/' configure.ac
# COMMON-PREP-END
2006-12-19 00:17:38 +01:00
2015-09-14 17:36:31 +02:00
%if %{suse_version} == 1315 && !0%{?is_opensuse}
cp %{SOURCE8} Lib/
%endif
2006-12-19 00:17:38 +01:00
%build
2019-05-29 11:09:16 +02:00
%define _lto_cflags %{nil}
2017-01-05 12:54:43 +01:00
export OPT=" %{optflags} - D O P E N S S L _ L O A D _ C O N F - f w r a p v "
2011-05-24 17:33:04 +02:00
2008-09-08 01:36:49 +02:00
autoreconf -f -i . # Modules/_ctypes/libffi
# prevent make from trying to rebuild asdl stuff, which requires existing
# python installation
touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h
2011-05-24 17:33:04 +02:00
2011-12-08 14:04:48 +01:00
%configure \
2008-05-07 00:09:21 +02:00
--docdir=%{_docdir} /python \
2006-12-19 00:17:38 +01:00
--enable-ipv6 \
--with-fpectl \
--enable-shared \
--enable-unicode=ucs4
2011-05-24 17:33:04 +02:00
2016-06-30 15:10:14 +02:00
LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH \
make %{?_smp_mflags}
2008-09-24 00:12:56 +02:00
%check
2006-12-19 00:17:38 +01:00
# on hppa, the threading of glibc is quite broken. The tests just stop
# at some point, and the machine does not build anything more until a
2011-12-08 14:04:48 +01:00
# timeout several hours later.
2013-06-27 18:01:09 +02:00
%ifnarch hppa
2008-04-09 00:44:31 +02:00
# Limit virtual memory to avoid spurious failures
if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then
ulimit -v 10000000 || :
fi
2019-07-19 13:20:26 +02:00
LIST=" t e s t _ u r l l i b t e s t _ s s l t e s t _ h a s h l i b t e s t _ h m a c t e s t _ u n i c o d e d a t a t e s t _ t a r f i l e t e s t _ s q l i t e t e s t _ t c l t e s t _ d b m t e s t _ a n y d b m t e s t _ d u m b d b m t e s t _ g d b m t e s t _ w h i c h d b t e s t _ t k t e s t _ t t k _ t e x t o n l y t e s t _ b s d d b t e s t _ b s d d b 3 t e s t _ r e a d l i n e "
2020-01-28 15:39:17 +01:00
make test TESTOPTS=" - w $ L I S T " TESTPYTHONOPTS=" - R "
2006-12-19 00:17:38 +01:00
%endif
%install
2008-10-13 16:53:57 +02:00
# replace rest of /usr/local/bin/python or /usr/bin/python2.x with /usr/bin/python
2016-06-30 15:10:14 +02:00
find . -name '*.py' -type f | grep -vE " ^ . / P a r s e r / | ^ . / P y t h o n / " \
| xargs grep -lE '^#! *(/usr/.*bin/(env +)?)?python' \
| xargs sed -r -i -e '1s@^#![[:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+\.[0-9]+)?@#!/usr/bin/python@'
2007-07-27 15:45:45 +02:00
# the grep inbetween makes it much faster
2006-12-19 00:17:38 +01:00
########################################
# install it
########################################
2011-12-08 14:04:48 +01:00
%make_install OPT=" %{optflags} - f P I C "
2006-12-19 00:17:38 +01:00
########################################
# some cleanups
########################################
# remove hard links and replace them with symlinks
for dir in bin include %{_lib} ; do
2011-12-08 14:04:48 +01:00
rm -f %{buildroot} /%{_prefix} /$dir/python
ln -s python%{python_version} %{buildroot} /%{_prefix} /$dir/python
2006-12-19 00:17:38 +01:00
done
2008-09-08 01:36:49 +02:00
# kill imageop.so, it's insecure
2011-12-08 14:04:48 +01:00
rm -f %{buildroot} /%{_libdir} /python%{python_version} /lib-dynload/imageop.so
2008-09-24 00:12:56 +02:00
#cleanup for -base
2012-03-30 19:00:51 +02:00
rm %{buildroot} %{_bindir} /python%{python_version}
rm %{buildroot} %{_bindir} /python2
rm %{buildroot} %{_bindir} /python
2011-12-08 14:04:48 +01:00
rm %{buildroot} %{_bindir} /smtpd.py
rm %{buildroot} %{_bindir} /pydoc
rm %{buildroot} %{_bindir} /2to3
rm %{buildroot} %{_mandir} /man1/python*
rm %{buildroot} %{_libdir} /libpython*.so.*
rm %{buildroot} %{_libdir} /python
2015-09-14 17:36:31 +02:00
find %{buildroot} %{_libdir} /python%{python_version} -maxdepth 1 \
! \( -name " s s l . p y * " -o -name " s l e _ t l s _ c h e c k s _ p o l i c y . p y * " \) \
-exec rm {} " ; "
2011-12-08 14:04:48 +01:00
rm %{buildroot} %{_bindir} /python%{python_version} -config
2012-03-30 19:00:51 +02:00
rm %{buildroot} %{_bindir} /python2-config
2011-12-08 14:04:48 +01:00
rm %{buildroot} %{_bindir} /python-config
rm %{buildroot} %{_libdir} /pkgconfig/*
rm -r %{buildroot} %{_includedir} /python
rm -r %{buildroot} %{_includedir} /python%{python_version}
rm -r %{buildroot} %{_libdir} /python%{python_version} /compiler
rm -r %{buildroot} %{_libdir} /python%{python_version} /config
rm -r %{buildroot} %{_libdir} /python%{python_version} /ctypes
rm -r %{buildroot} %{_libdir} /python%{python_version} /distutils
rm -r %{buildroot} %{_libdir} /python%{python_version} /email
rm -r %{buildroot} %{_libdir} /python%{python_version} /encodings
2014-12-15 16:06:19 +01:00
rm -r %{buildroot} %{_libdir} /python%{python_version} /ensurepip
2011-12-08 14:04:48 +01:00
rm -r %{buildroot} %{_libdir} /python%{python_version} /hotshot
rm -r %{buildroot} %{_libdir} /python%{python_version} /importlib
rm -r %{buildroot} %{_libdir} /python%{python_version} /json
rm -r %{buildroot} %{_libdir} /python%{python_version} /lib2to3
rm -r %{buildroot} %{_libdir} /python%{python_version} /logging
rm -r %{buildroot} %{_libdir} /python%{python_version} /multiprocessing
rm -r %{buildroot} %{_libdir} /python%{python_version} /plat-*
rm -r %{buildroot} %{_libdir} /python%{python_version} /pydoc_data
rm -r %{buildroot} %{_libdir} /python%{python_version} /test
rm -r %{buildroot} %{_libdir} /python%{python_version} /unittest
rm -r %{buildroot} %{_libdir} /python%{python_version} /wsgiref
rm -r %{buildroot} %{_libdir} /python%{python_version} /xml
rm %{buildroot} %{_libdir} /libpython%{python_version} .so
rm %{buildroot} %{_libdir} /python%{python_version} /site-packages/README
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_bisect.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_csv.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_collections.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_ctypes.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_ctypes_test.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_elementtree.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_functools.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_heapq.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_hotshot.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_io.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_json.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_locale.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_lsprof.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_multiprocessing.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_random.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_socket.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_struct.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_testcapi.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/array.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/binascii.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/bz2.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/cPickle.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/cStringIO.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/cmath.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/crypt.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/datetime.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/fcntl.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/future_builtins.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/grp.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/itertools.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/linuxaudiodev.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/math.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/mmap.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/nis.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/operator.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/ossaudiodev.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/parser.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/pyexpat.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/resource.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/select.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/spwd.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/strop.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/syslog.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/termios.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/time.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/unicodedata.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/zlib.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_codecs*.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/_multibytecodec.so
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/audioop.so
rm -f %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/dl.so
2012-03-29 19:02:42 +02:00
rm %{buildroot} %{_libdir} /python%{python_version} /lib-dynload/Python-%{tarversion} -py%{python_version} .egg-info
2007-08-06 22:02:29 +02:00
# replace duplicate .pyo/.pyc with hardlinks
2011-12-08 14:04:48 +01:00
%fdupes %{buildroot} /%{_libdir} /python%{python_version}
2006-12-19 00:17:38 +01:00
########################################
# documentation
########################################
2011-12-08 14:04:48 +01:00
export PDOCS=%{buildroot} %{_docdir} /%{name}
2006-12-19 00:17:38 +01:00
install -d -m 755 $PDOCS
2011-12-08 14:04:48 +01:00
install -c -m 644 %{SOURCE1} $PDOCS/
2006-12-19 00:17:38 +01:00
install -c -m 644 LICENSE $PDOCS/
install -c -m 644 README $PDOCS/
########################################
# tools and demos
########################################
find Tools/ Demo/ -type d \( -regex " . * / . c v s i g n o r e " \) -exec rm -f \{\} \;
for x in `find Tools/ Demo/ \( -not -name Makefile \) -print | sort` ; do
test -d $x && ( install -c -m 755 -d $PDOCS/$x ) \
|| ( install -c -m 644 $x $PDOCS/$x )
done
########################################
# idle
########################################
# move idle config into /etc
2011-12-08 14:04:48 +01:00
install -d -m755 %{buildroot} %{_sysconfdir} /%{idle_name}
(
cd %{buildroot} /%{_libdir} /python%{python_version} /idlelib/
2006-12-19 00:17:38 +01:00
for file in *.def ; do
2011-12-08 14:04:48 +01:00
mv $file %{buildroot} %{_sysconfdir} /%{idle_name} /
ln -sf /etc/%{idle_name} /$file %{buildroot} /%{_libdir} /python%{python_version} /idlelib/
2006-12-19 00:17:38 +01:00
done
)
2019-12-11 17:37:24 +01:00
# Install .desktop, mime and appdata files from upstream tarball
%if 0%{?suse_version} >= 1500
install -Dm0644 %{SOURCE50} %{buildroot} /%{_datadir} /mime/packages/idle.appdata.xml
%endif
install -D -m 0644 Lib/idlelib/Icons/idle_16.png %{buildroot} %{_datadir} /icons/hicolor/16x16/apps/idle.png
install -D -m 0644 Lib/idlelib/Icons/idle_32.png %{buildroot} %{_datadir} /icons/hicolor/32x32/apps/idle.png
install -D -m 0644 Lib/idlelib/Icons/idle_48.png %{buildroot} %{_datadir} /icons/hicolor/48x48/apps/idle.png
desktop-file-install --dir=%{buildroot} %{_datadir} /applications %{SOURCE51}
2010-10-04 15:38:36 +02:00
%post -p /sbin/ldconfig
2006-12-19 00:17:38 +01:00
2010-10-04 15:38:36 +02:00
%postun -p /sbin/ldconfig
2006-12-19 00:17:38 +01:00
%files idle
%defattr (644, root, root, 755)
2011-12-08 14:04:48 +01:00
%dir %{_sysconfdir} /%{idle_name}
%config %{_sysconfdir} /%{idle_name} /*
2006-12-19 00:17:38 +01:00
%doc Lib/idlelib/NEWS.txt
%doc Lib/idlelib/README.txt
%doc Lib/idlelib/TODO.txt
%doc Lib/idlelib/extend.txt
%doc Lib/idlelib/ChangeLog
%{_libdir} /python%{python_version} /idlelib
%attr (755, root, root) %{_bindir} /%{idle_name}
2019-12-11 17:37:24 +01:00
%if 0%{?suse_version} >= 1500
%{_datadir} /mime/packages/idle.appdata.xml
%endif
%{_datadir} /applications/idle.desktop
%{_datadir} /icons/hicolor/*/apps/idle.png
2006-12-19 00:17:38 +01:00
%files demo
%defattr (644, root, root, 755)
%doc %{_docdir} /%{name} /Demo
%doc %{_docdir} /%{name} /Tools
%files tk
%defattr (644, root, root, 755)
%{_libdir} /python%{python_version} /lib-tk/
%{_libdir} /python%{python_version} /lib-dynload/_tkinter.so
%files curses
%defattr (644, root, root, 755)
%{_libdir} /python%{python_version} /curses
%{_libdir} /python%{python_version} /lib-dynload/_curses.so
%{_libdir} /python%{python_version} /lib-dynload/_curses_panel.so
%files gdbm
%defattr (644, root, root, 755)
%{_libdir} /python%{python_version} /lib-dynload/gdbm.so
2008-09-24 00:12:56 +02:00
%{_libdir} /python%{python_version} /lib-dynload/dbm.so
2006-12-19 00:17:38 +01:00
2015-09-14 17:36:31 +02:00
%if %{suse_version} == 1315 && !0%{?is_opensuse}
%files strict-tls-check
%defattr (644, root, root, 755)
%{_libdir} /python%{python_version} /sle_tls_checks_policy.py*
%endif
2006-12-19 00:17:38 +01:00
%files
%defattr (644, root, root, 755)
%dir %{_docdir} /%{name}
%doc %{_docdir} /%{name} /README
%doc %{_docdir} /%{name} /LICENSE
%doc %{_docdir} /%{name} /README.SUSE
%dir %{_libdir} /python%{python_version}
2008-09-24 00:12:56 +02:00
%{_libdir} /python%{python_version} /ssl.py*
2008-12-19 15:13:49 +01:00
%{_libdir} /python%{python_version} /bsddb
2006-12-19 00:17:38 +01:00
%{_libdir} /python%{python_version} /sqlite3
%dir %{_libdir} /python%{python_version} /lib-dynload
2008-12-19 15:13:49 +01:00
%{_libdir} /python%{python_version} /lib-dynload/_bsddb.so
2006-12-19 00:17:38 +01:00
%{_libdir} /python%{python_version} /lib-dynload/_hashlib.so
2008-09-08 01:36:49 +02:00
%{_libdir} /python%{python_version} /lib-dynload/_sqlite3.so
2006-12-19 00:17:38 +01:00
%{_libdir} /python%{python_version} /lib-dynload/_ssl.so
%{_libdir} /python%{python_version} /lib-dynload/readline.so
2008-03-11 17:57:23 +01:00
2007-03-23 21:32:32 +01:00
%changelog