From 56b8f56788b082fc54dedbb003b2891294dd6c22 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 12 Jan 2016 17:27:40 +0100 Subject: daemon: Canonicalize gids to 0. Previously files in the Nix store were owned by root or by nixbld, depending on whether they were created by a substituter or by a builder. This doesn't matter much, but causes spurious diffoscope differences. So use root everywhere. --- nix/libstore/local-store.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/libstore/local-store.cc b/nix/libstore/local-store.cc index 11f61ae030..1eed0ca77f 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()); -- cgit v1.2.3