Open /dev/urandom with O_CLOEXEC.
Let's avoid bleeding file descriptors into our clients' children, shall we? XXX pullup
This commit is contained in:
parent
57d4369975
commit
86465dbe5a
@ -479,7 +479,7 @@ static int get_random_device(size_t n)
|
|||||||
return rd->fd;
|
return rd->fd;
|
||||||
|
|
||||||
/* open the random device ... */
|
/* 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;
|
return rd->fd;
|
||||||
|
|
||||||
/* ... and cache its relevant stat(2) data */
|
/* ... and cache its relevant stat(2) data */
|
||||||
|
Loading…
Reference in New Issue
Block a user