summaryrefslogtreecommitdiff
path: root/nix/libstore/local-store.cc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-06-07 11:54:03 +0200
committerLudovic Courtès <ludo@gnu.org>2016-06-07 11:54:03 +0200
commitaeafff536f933b07836b14d089dfc52b0e432ec9 (patch)
tree4ede554999f98cf9e19c04098c934db52efae795 /nix/libstore/local-store.cc
parent9dee9e8ffe4650949bd3ad2edf559cf4a33e9e6e (diff)
parentf82c58539e1f7b9b864e68ea2ab0c6a17c15fbb5 (diff)
downloadpatches-aeafff536f933b07836b14d089dfc52b0e432ec9.tar
patches-aeafff536f933b07836b14d089dfc52b0e432ec9.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'nix/libstore/local-store.cc')
-rw-r--r--nix/libstore/local-store.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/nix/libstore/local-store.cc b/nix/libstore/local-store.cc
index 11f61ae030..347e8a703f 100644
--- a/nix/libstore/local-store.cc
+++ b/nix/libstore/local-store.cc
@@ -606,10 +606,10 @@ static void canonicalisePathMetaData_(const Path & path, uid_t fromUid, InodesSe
users group); we check for this case below. */
if (st.st_uid != geteuid()) {
#if HAVE_LCHOWN
- if (lchown(path.c_str(), geteuid(), (gid_t) -1) == -1)
+ if (lchown(path.c_str(), geteuid(), getegid()) == -1)
#else
if (!S_ISLNK(st.st_mode) &&
- chown(path.c_str(), geteuid(), (gid_t) -1) == -1)
+ chown(path.c_str(), geteuid(), getegid()) == -1)
#endif
throw SysError(format("changing owner of `%1%' to %2%")
% path % geteuid());
@@ -1213,6 +1213,9 @@ template<class T> T LocalStore::getIntLineFromSubstituter(RunningSubstituter & r
PathSet LocalStore::querySubstitutablePaths(const PathSet & paths)
{
PathSet res;
+
+ if (!settings.useSubstitutes) return res;
+
foreach (Paths::iterator, i, settings.substituters) {
if (res.size() == paths.size()) break;
RunningSubstituter & run(runningSubstituters[*i]);
@@ -1239,6 +1242,8 @@ PathSet LocalStore::querySubstitutablePaths(const PathSet & paths)
void LocalStore::querySubstitutablePathInfos(const Path & substituter,
PathSet & paths, SubstitutablePathInfos & infos)
{
+ if (!settings.useSubstitutes) return;
+
RunningSubstituter & run(runningSubstituters[substituter]);
startSubstituter(substituter, run);
if (run.disabled) return;