pkgsrc/www/firefox/patches/patch-af

26 lines
629 B
Text
Raw Normal View History

$NetBSD: patch-af,v 1.3 2005/09/22 14:14:04 jlam Exp $
--- security/nss/lib/freebl/unix_rand.c.orig 2003-05-30 23:31:19.000000000 +0000
+++ security/nss/lib/freebl/unix_rand.c
@@ -32,6 +32,7 @@
*/
#include <stdio.h>
+#include <fcntl.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
@@ -691,7 +692,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);
+ }
for (fd = getdtablesize(); --fd > 2; close(fd))
;