aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 0b8900f25..2f3f3a7da 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -235,10 +235,10 @@ void canonicalisePathMetaData(const Path & path)
throw SysError(format("changing mode of `%1%' to %2$o") % path % mode);
}
- if (st.st_uid != getuid() || st.st_gid != getgid()) {
- if (chown(path.c_str(), getuid(), getgid()) == -1)
+ if (st.st_uid != geteuid() || st.st_gid != getegid()) {
+ if (chown(path.c_str(), geteuid(), getegid()) == -1)
throw SysError(format("changing owner/group of `%1%' to %2%/%3%")
- % path % getuid() % getgid());
+ % path % geteuid() % getegid());
}
if (st.st_mtime != 0) {