aboutsummaryrefslogtreecommitdiff
path: root/src/nix-worker
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-04-15 00:42:16 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-04-15 00:42:16 +0200
commit154aa7f71ade55fe5ce43503ade85fc2a107a331 (patch)
tree645bece4e96fdca99b68d582a3be86fc2953585a /src/nix-worker
parent31e34fcf932e86c398a38b39facc268026736f0c (diff)
Set a few more close-on-exec flags
Diffstat (limited to 'src/nix-worker')
-rw-r--r--src/nix-worker/nix-worker.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc
index a95252350..4b0c9e319 100644
--- a/src/nix-worker/nix-worker.cc
+++ b/src/nix-worker/nix-worker.cc
@@ -697,6 +697,8 @@ static void daemonLoop()
if (fdSocket == -1)
throw SysError("cannot create Unix domain socket");
+ closeOnExec(fdSocket);
+
string socketPath = nixStateDir + DEFAULT_SOCKET_PATH;
createDirs(dirOf(socketPath));
@@ -751,6 +753,8 @@ static void daemonLoop()
throw SysError("accepting connection");
}
+ closeOnExec(remote);
+
/* Get the identity of the caller, if possible. */
uid_t clientUid = -1;
pid_t clientPid = -1;