Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssl/dist/crypto/rand Open /dev/urand...



details:   https://anonhg.NetBSD.org/src/rev/e0a7c64cb41a
branches:  trunk
changeset: 848965:e0a7c64cb41a
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Feb 15 23:19:37 2020 +0000

description:
Open /dev/urandom with O_CLOEXEC.

Let's avoid bleeding file descriptors into our clients' children,
shall we?

XXX pullup

diffstat:

 crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r e01fd6e22294 -r e0a7c64cb41a crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c
--- a/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c  Sat Feb 15 22:55:22 2020 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c  Sat Feb 15 23:19:37 2020 +0000
@@ -479,7 +479,7 @@
         return rd->fd;
 
     /* open the random device ... */
-    if ((rd->fd = open(random_device_paths[n], O_RDONLY)) == -1)
+    if ((rd->fd = open(random_device_paths[n], O_RDONLY|O_CLOEXEC)) == -1)
         return rd->fd;
 
     /* ... and cache its relevant stat(2) data */



Home | Main Index | Thread Index | Old Index