guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

08/09: daemon: Canonicalize gids to 0.


From: Ludovic Courtès
Subject: 08/09: daemon: Canonicalize gids to 0.
Date: Tue, 31 May 2016 12:34:02 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 56b8f56788b082fc54dedbb003b2891294dd6c22
Author: Eelco Dolstra <address@hidden>
Date:   Tue Jan 12 17:27:40 2016 +0100

    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 11f61ae..1eed0ca 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());



reply via email to

[Prev in Thread] Current Thread [Next in Thread]