Max Kellermann wrote:
> The function _gcry_rndlinux_gather_random() in
cipher/rndlinux.c opens
> two file handles (fd_random and fd_urandom) which are
never closed.
> Since it does not apply the FD_CLOEXEC flag, all
subprocesses will
> inherit these two handles without ever using them.
>
> Please apply this patch which sets the FD_CLOEXEC flag.
The correct way to set this flag is this:
{
int flags = fcntl(fd, F_GETFD);
flags |= FD_CLOEXEC;
fcntl(fd, F_SETFD, flags);
}
Paranoids would even check for errors.
--
Christian
_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
|