about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-26T19·04-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-26T19·04-0400
commit3a4623afbbc1bff85bde33167d36e8c5a4a3df0d (patch)
tree5e39b404333b720d711da1c04489b631b878ecf8 /src/libstore
parent2605f4f4e6a367df67bf8b33b252c350313699c9 (diff)
Set permissions on temporary build directories to 0700
Fixes #39.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index a3bde3462364..290635695e05 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1527,7 +1527,7 @@ void DerivationGoal::startBuilder()
 
     /* Create a temporary directory where the build will take
        place. */
-    tmpDir = createTempDir("", "nix-build-" + baseNameOf(drvPath), false, false);
+    tmpDir = createTempDir("", "nix-build-" + baseNameOf(drvPath), false, false, 0700);
 
     /* For convenience, set an environment pointing to the top build
        directory. */
@@ -2178,6 +2178,7 @@ void DerivationGoal::deleteTmpDir(bool force)
                 % drvPath % tmpDir);
             if (buildUser.enabled() && !amPrivileged())
                 getOwnership(tmpDir);
+            chmod(tmpDir.c_str(), 0755);
         }
         else
             deletePathWrapped(tmpDir);