From 862c4c5ec509e05815d99fb4b80558974148b8c5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 19 Aug 2012 16:32:42 -0400 Subject: Fix 1755 permission on temporary directories left behind by ‘-K’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libstore/build.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libstore/build.cc') diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 91f235b7ab10..a7aea164c0a4 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; -- cgit 1.4.1