]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_utilities/lib/daemon.cpp
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_utilities / lib / daemon.cpp
index f06ced9842773ce5b6d9064b6dde7c65a5207b38..780174a76d453cc8fe5d48315704841b608ef2d6 100644 (file)
@@ -36,7 +36,6 @@
 namespace Security {
 namespace Daemon {
 
-
 //
 // Daemonize this process, the UNIX way.
 //
@@ -82,31 +81,5 @@ bool incarnate(bool doFork /*=true*/)
        return true;
 }
 
-
-//
-// Re-execute myself.
-// This is a pretty bad hack for libraries that are pretty broken and (essentially)
-// don't work after a fork() unless you also exec().
-//
-// WARNING: Don't even THINK of doing this in a setuid-anything program.
-//
-bool executeSelf(char **argv)
-{
-       static const char reExecEnv[] = "_RE_EXECUTE";
-       if (getenv(reExecEnv)) {                // was re-executed
-               secinfo("daemon", "self-execution complete");
-               unsetenv(reExecEnv);
-               return true;
-       } else {
-               setenv(reExecEnv, "go", 1);
-               secinfo("daemon", "self-executing (ouch!)");
-               execv(argv[0], argv);
-               perror("re-execution");
-               Syslog::error("Re-execution attempt failed");
-               return false;
-       }
-}
-
-
 } // end namespace Daemon
 } // end namespace Security