Merge branch 'tr/protect-low-3-fds'
[gitweb.git] / daemon.c
index 6aeddcb98d2694a705d34e80293fc81a20bc39a8..973ec38fafd6e679eeebc7c013163fbefe57ec05 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -1047,18 +1047,6 @@ static int service_loop(struct socketlist *socklist)
        }
 }
 
-/* if any standard file descriptor is missing open it to /dev/null */
-static void sanitize_stdfds(void)
-{
-       int fd = open("/dev/null", O_RDWR, 0);
-       while (fd != -1 && fd < 2)
-               fd = dup(fd);
-       if (fd == -1)
-               die_errno("open /dev/null or dup failed");
-       if (fd > 2)
-               close(fd);
-}
-
 #ifdef NO_POSIX_GOODIES
 
 struct credentials;