Blame 00250-getentropy.patch

028378c
diff --git a/Python/random.c b/Python/random.c
028378c
index af3d0bd..5451815 100644
028378c
--- a/Python/random.c
028378c
+++ b/Python/random.c
028378c
@@ -68,8 +68,15 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
028378c
 }
028378c
 
028378c
 /* Issue #25003: Don' use getentropy() on Solaris (available since
028378c
- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */
028378c
-#elif defined(HAVE_GETENTROPY) && !defined(sun)
028378c
+   Solaris 11.3), it is blocking whereas os.urandom() should not block.
028378c
+
028378c
+   Issue #29188: Don't use getentropy() on Linux since the glibc 2.24
028378c
+   implements it with the getrandom() syscall which can fail with ENOSYS,
028378c
+   and this error is not supported in py_getentropy() and getrandom() is called
028378c
+   with flags=0 which blocks until system urandom is initialized, which is not
028378c
+   the desired behaviour to seed the Python hash secret nor for os.urandom():
028378c
+   see the PEP 524 which was only implemented in Python 3.6. */
028378c
+#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux)
028378c
 #define PY_GETENTROPY 1
028378c
 
028378c
 /* Fill buffer with size pseudo-random bytes generated by getentropy().