]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
python: Update to 2.7.13
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 28 Apr 2017 11:10:41 +0000 (13:10 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 18 May 2017 11:08:00 +0000 (12:08 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/python
src/patches/python-2.7.13-getentropy.patch [new file with mode: 0644]

index 013f9c1a8ad43b16a76dedc3ddb9e19ebe86c687..14ccb690c9e3111b0206759cc9c99cbd07169710 100644 (file)
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 2.7.10
+VER        = 2.7.13
 
 THISAPP    = Python-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = c685ef0b8e9f27b5e3db5db12b268ac6
+$(DL_FILE)_MD5 = 53b43534153bb2a0363f08bae8b9d990
 
 install : $(TARGET)
 
@@ -71,6 +71,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar Jxf $(DIR_DL)/$(DL_FILE)
        rm -rf $(DIR_APP)/Modules/_ctypes/{darwin,libffi,libffi_arm_wince,libffi_msvc,libffi_osx}
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/python-2.7.13-getentropy.patch
        cd $(DIR_APP) && OPT="$(CFLAGS)" ./configure \
                --prefix=/usr --enable-shared --with-system-ffi
        cd $(DIR_APP) && make $(MAKETUNING)
diff --git a/src/patches/python-2.7.13-getentropy.patch b/src/patches/python-2.7.13-getentropy.patch
new file mode 100644 (file)
index 0000000..7e00061
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/Python/random.c b/Python/random.c
+index 2f83b5d..4cae217 100644
+--- a/Python/random.c
++++ b/Python/random.c
+@@ -97,8 +97,15 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
+ }
+ /* Issue #25003: Don't use getentropy() on Solaris (available since
+- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
+-#elif defined(HAVE_GETENTROPY) && !defined(sun)
++   Solaris 11.3), it is blocking whereas os.urandom() should not block.
++
++   Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
++   implements it with the getrandom() syscall which can fail with ENOSYS,
++   and this error is not supported in py_getentropy() and getrandom() is called
++   with flags=0 which blocks until system urandom is initialized, which is not
++   the desired behaviour to seed the Python hash secret nor for os.urandom():
++   see the PEP 524 which was only implemented in Python 3.6. */
++#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
+ #define PY_GETENTROPY 1
+ /* Fill buffer with size pseudo-random bytes generated by getentropy().