From 862c4c5ec509e05815d99fb4b80558974148b8c5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 19 Aug 2012 16:32:42 -0400 Subject: =?UTF-8?q?Fix=201755=20permission=20on=20temporary=20directories?= =?UTF-8?q?=20left=20behind=20by=20=E2=80=98-K=E2=80=99?= 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') 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; -- cgit v1.2.3