kumquat-buildroot/package/python3/0023-Add-an-option-to-disable-IDLE.patch
Adam Duskett 906ed044aa package/python3: security bump to version 3.7.4
Fixes the following security issues:

- bpo-37463: ssl.match_hostname() no longer accepts IPv4 addresses with
  additional text after the address and only quad-dotted notation without
  trailing whitespaces.  Some inet_aton() implementations ignore whitespace
  and all data after whitespace, e.g.  ‘127.0.0.1 whatever’.

- bpo-35907: CVE-2019-9948: Avoid file reading by disallowing local-file://
  and local_file:// URL schemes in URLopener().open() and
  URLopener().retrieve() of urllib.request.

- bpo-30458: Address CVE-2019-9740 by disallowing URL paths with embedded
  whitespace or control characters through into the underlying http client
  request.  Such potentially malicious header injection URLs now cause an
  http.client.InvalidURL exception to be raised.

- bpo-33529: Prevent fold function used in email header encoding from
  entering infinite loop when there are too many non-ASCII characters in a
  header.

- bpo-35755: shutil.which() now uses os.confstr("CS_PATH") if available and
  if the PATH environment variable is not set.  Remove also the current
  directory from posixpath.defpath.  On Unix, shutil.which() and the
  subprocess module no longer search the executable in the current directory
  if the PATH environment variable is not set.

Also remove the following upstreamed patches:
  - 0033-bpo-36742-Fixes-handling-of-pre-normalization-charac.patch
  - 0034-bpo-36742-Corrects-fix-to-handle-decomposition-in-us.patch

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
[Peter: mention security fixes]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-07-14 12:03:05 +02:00

90 lines
2.9 KiB
Diff

From 5bbd94f014c89665d02a8a32442822ab7c5520d0 Mon Sep 17 00:00:00 2001
From: Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Wed, 22 Feb 2017 17:45:14 -0800
Subject: [PATCH] Add an option to disable IDLE
IDLE is an IDE embedded into python, written using Tk, so it doesn't make
much sense to have it into our build.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
[ Andrey Smirnov: ported to Python 3.6 ]
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
Makefile.pre.in | 7 ++++++-
configure.ac | 6 ++++++
setup.py | 4 +++-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/Makefile.pre.in b/Makefile.pre.in
index dc4b92b6fe..3e43066d90 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1229,7 +1229,9 @@ bininstall: altbininstall
-rm -f $(DESTDIR)$(LIBPC)/python3.pc
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
-rm -f $(DESTDIR)$(BINDIR)/idle3
+ifeq (@IDLE@,yes)
(cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
+endif
-rm -f $(DESTDIR)$(BINDIR)/pydoc3
ifeq (@PYDOC@,yes)
(cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
@@ -1274,7 +1276,6 @@ LIBSUBDIRS= site-packages \
html json http dbm xmlrpc \
logging csv wsgiref urllib \
ctypes ctypes/macholib \
- idlelib idlelib/Icons \
distutils distutils/command \
importlib \
turtledemo \
@@ -1360,6 +1361,10 @@ ifeq (@EXPAT@,yes)
LIBSUBDIRS += $(XMLLIBSUBDIRS)
endif
+ifeq (@IDLE@,yes)
+LIBSUBDIRS += idlelib idlelib/Icons
+endif
+
ifeq (@LIB2TO3@,yes)
LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2
TESTSUBDIRS += lib2to3/tests \
diff --git a/configure.ac b/configure.ac
index 1d610e132b..2699e7ceb1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3297,6 +3297,12 @@ AC_ARG_ENABLE(lib2to3,
AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]),
[ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ])
+AC_SUBST(IDLE)
+
+AC_ARG_ENABLE(idle3,
+ AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]),
+ [ IDLE="${enableval}" ], [ IDLE=yes ])
+
# Check for enable-ipv6
AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
AC_MSG_CHECKING([if --enable-ipv6 is specified])
diff --git a/setup.py b/setup.py
index 38aa5e605e..d642825c1e 100644
--- a/setup.py
+++ b/setup.py
@@ -2377,11 +2377,13 @@ def main():
import warnings
warnings.filterwarnings("ignore",category=DeprecationWarning)
- scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py']
+ scripts = [ 'Lib/smtpd.py']
if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
scripts += [ 'Tools/scripts/pydoc3' ]
if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"):
scripts += [ 'Tools/scripts/2to3' ]
+ if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"):
+ scripts += [ 'Tools/scripts/idle3' ]
setup(# PyPI Metadata (PEP 301)
name = "Python",
--
2.13.5