about summary refs log tree commit diff
path: root/src/libmain
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-07T16·40+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-07T16·40+0000
commita82d80ddeb6f68ff136124dfb591a404bb195ea3 (patch)
treeb40ce775db3ae90451637f3e61ae4a5fb5ec3ccf /src/libmain
parentf76fdb6d42a1b539fcf0b77d8efc5262283a19ea (diff)
* Move setuidCleanup() to libutil.
Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/setuid-common.hh22
-rw-r--r--src/libmain/shared.cc3
2 files changed, 0 insertions, 25 deletions
diff --git a/src/libmain/setuid-common.hh b/src/libmain/setuid-common.hh
deleted file mode 100644
index a3e840996161..000000000000
--- a/src/libmain/setuid-common.hh
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Code shared between libmain and nix-setuid-helper. */
-
-extern char * * environ;
-
-
-namespace nix {
-    
-
-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();
-    }
-}
-
- 
-}
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index fa72ca5bc444..d7fb240192b6 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -14,9 +14,6 @@
 #include <aterm2.h>
 
 
-#include "setuid-common.hh"
-
-
 namespace nix {