$NetBSD: patch-af,v 1.1.1.1 2006/02/05 21:56:25 ghen Exp $ --- security/nss/lib/freebl/unix_rand.c.orig 2006-02-02 16:57:57.000000000 +0100 +++ security/nss/lib/freebl/unix_rand.c @@ -35,6 +35,7 @@ * ***** END LICENSE BLOCK ***** */ #include +#include #include #include #include @@ -694,7 +695,11 @@ safe_popen(char *cmd) /* dup write-side of pipe to stderr and stdout */ if (p[1] != 1) dup2(p[1], 1); if (p[1] != 2) dup2(p[1], 2); - close(0); + fd = open("/dev/null", O_RDONLY); + if (fd != 0) { + dup2(fd, 0); + close(fd); + } { int ndesc = getdtablesize(); for (fd = PR_MIN(65536, ndesc); --fd > 2; close(fd));