components/python/python35/patches/26-getrandom.patch
author John Beck <John.Beck@Oracle.COM>
Mon, 06 Feb 2017 13:54:36 -0800
changeset 7648 20e09cf3cfaa
parent 6447 56a2f066191a
permissions -rw-r--r--
25429083 Upgrade Python 3.5 line to 3.5.3

This patch was originated in-house.  It is to work around a bug (21825650)
in getrandom(2).  That bug was fixed in S12, and in an 11.3 SRU, but not in
time for 11.3 GA, so this patch is still needed for FOSS Evaluation builds.

--- Python-3.5.3/Python/random.c.~1~	2017-01-17 11:31:43.712295534 +0000
+++ Python-3.5.3/Python/random.c	2017-01-17 11:34:15.498815511 +0000
@@ -185,7 +185,7 @@
             /* ENOSYS: getrandom() syscall not supported by the kernel (but
              * maybe supported by the host which built Python). EPERM:
              * getrandom() syscall blocked by SECCOMP or something else. */
-            if (errno == ENOSYS || errno == EPERM) {
+            if (errno == ENOSYS || errno == EINVAL || errno == EPERM) {
                 getrandom_works = 0;
                 return 0;
             }