aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-19 16:32:42 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-19 16:32:42 -0400
commit862c4c5ec509e05815d99fb4b80558974148b8c5 (patch)
tree6e65e3e2c77204e2d73e4ba4e2c16318b709c42e
parent767101824af1fe41b6e50791b21112c6a8d7457f (diff)
Fix 1755 permission on temporary directories left behind by ‘-K’
-rw-r--r--src/libstore/build.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 91f235b7a..a7aea164c 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1471,9 +1471,9 @@ HookReply DerivationGoal::tryBuildHook()
}
-void chmod(const Path & path, mode_t mode)
+void chmod_(const Path & path, mode_t mode)
{
- if (::chmod(path.c_str(), 01777) == -1)
+ if (chmod(path.c_str(), mode) == -1)
throw SysError(format("setting permissions on `%1%'") % path);
}
@@ -1675,7 +1675,7 @@ void DerivationGoal::startBuilder()
instead.) */
Path chrootTmpDir = chrootRootDir + "/tmp";
createDirs(chrootTmpDir);
- chmod(chrootTmpDir, 01777);
+ chmod_(chrootTmpDir, 01777);
/* Create a /etc/passwd with entries for the build user and the
nobody account. The latter is kind of a hack to support
@@ -1719,7 +1719,7 @@ void DerivationGoal::startBuilder()
precaution, make the fake Nix store only writable by the
build user. */
createDirs(chrootRootDir + nixStore);
- chmod(chrootRootDir + nixStore, 01777);
+ chmod_(chrootRootDir + nixStore, 01777);
foreach (PathSet::iterator, i, inputPaths) {
struct stat st;