diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2018-11-11 19:50:10 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2018-11-11 19:50:10 -0500 |
commit | db08466131a2d495e4bf58e34bf8d0090be04a2d (patch) | |
tree | 2fd45693106f04ba0f7efb3e7548db680b5eea1f /src | |
parent | 5e52fdc5f8f3b6c970051c1bf3325b2d0ed8a5db (diff) | |
download | cryptography-db08466131a2d495e4bf58e34bf8d0090be04a2d.tar.gz cryptography-db08466131a2d495e4bf58e34bf8d0090be04a2d.tar.bz2 cryptography-db08466131a2d495e4bf58e34bf8d0090be04a2d.zip |
Revert O_CLOEXEC change to fix builds (#4570)
Diffstat (limited to 'src')
-rw-r--r-- | src/_cffi_src/openssl/src/osrandom_engine.c | 11 | ||||
-rw-r--r-- | src/cryptography/__about__.py | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/_cffi_src/openssl/src/osrandom_engine.c b/src/_cffi_src/openssl/src/osrandom_engine.c index 24dedda4..947c79aa 100644 --- a/src/_cffi_src/openssl/src/osrandom_engine.c +++ b/src/_cffi_src/openssl/src/osrandom_engine.c @@ -92,7 +92,7 @@ static struct { /* return -1 on error */ static int dev_urandom_fd(void) { - int fd, n; + int fd, n, flags; struct stat st; /* Check that fd still points to the correct device */ @@ -106,13 +106,20 @@ static int dev_urandom_fd(void) { } } if (urandom_cache.fd < 0) { - fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC); + fd = open("/dev/urandom", O_RDONLY); if (fd < 0) { goto error; } if (fstat(fd, &st)) { goto error; } + /* set CLOEXEC flag */ + flags = fcntl(fd, F_GETFD); + if (flags == -1) { + goto error; + } else if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) { + goto error; + } /* Another thread initialized the fd */ if (urandom_cache.fd >= 0) { do { diff --git a/src/cryptography/__about__.py b/src/cryptography/__about__.py index e27f8c06..adedd762 100644 --- a/src/cryptography/__about__.py +++ b/src/cryptography/__about__.py @@ -14,7 +14,7 @@ __summary__ = ("cryptography is a package which provides cryptographic recipes" " and primitives to Python developers.") __uri__ = "https://github.com/pyca/cryptography" -__version__ = "2.4" +__version__ = "2.4.1" __author__ = "The cryptography developers" __email__ = "cryptography-dev@python.org" |