about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.cc13
-rw-r--r--src/libutil/util.hh4
2 files changed, 0 insertions, 17 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 8fd61826fa28..9437a2f99a3c 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -968,19 +968,6 @@ void closeOnExec(int fd)
 }
 
 
-void setuidCleanup()
-{
-    /* Don't trust the environment. */
-    environ = 0;
-
-    /* Make sure that file descriptors 0, 1, 2 are open. */
-    for (int fd = 0; fd <= 2; ++fd) {
-        struct stat st;
-        if (fstat(fd, &st) == -1) abort();
-    }
-}
-
-
 #if HAVE_VFORK
 pid_t (*maybeVfork)() = vfork;
 #else
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 86c65b763d00..2335cbf98820 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -268,10 +268,6 @@ void closeMostFDs(const set<int> & exceptions);
 /* Set the close-on-exec flag for the given file descriptor. */
 void closeOnExec(int fd);
 
-/* Common initialisation for setuid programs: clear the environment,
-   sanitize file handles 0, 1 and 2. */
-void setuidCleanup();
-
 /* Call vfork() if available, otherwise fork(). */
 extern pid_t (*maybeVfork)();