about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/local-store.cc4
-rw-r--r--src/nix-setuid-helper/nix-setuid-helper.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 56d97a048aad..cace5cb60b36 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -205,10 +205,10 @@ static void _canonicalisePathMetaData(const Path & path)
        users group); we check for this case below. */
     if (st.st_uid != geteuid()) {
 #if HAVE_LCHOWN
-        if (lchown(path.c_str(), geteuid(), -1) == -1)
+        if (lchown(path.c_str(), geteuid(), (gid_t) -1) == -1)
 #else
         if (!S_ISLNK(st.st_mode) &&
-            chown(path.c_str(), geteuid(), -1) == -1)
+            chown(path.c_str(), geteuid(), (gid_t) -1) == -1)
 #endif
             throw SysError(format("changing owner of `%1%' to %2%")
                 % path % geteuid());
diff --git a/src/nix-setuid-helper/nix-setuid-helper.cc b/src/nix-setuid-helper/nix-setuid-helper.cc
index ffb2abc1f164..58df479fc845 100644
--- a/src/nix-setuid-helper/nix-setuid-helper.cc
+++ b/src/nix-setuid-helper/nix-setuid-helper.cc
@@ -105,7 +105,7 @@ static void runBuilder(uid_t uidNix, gid_t gidBuildUsers,
        account.  The idea is that the current directory is the
        temporary build directory in /tmp or somewhere else, and we
        don't want to create that directory here. */
-    secureChown(uidNix, -1, uidTargetUser, gidBuildUsers, ".");
+    secureChown(uidNix, (gid_t) -1, uidTargetUser, gidBuildUsers, ".");
 
     /* Set the real, effective and saved gid.  Must be done before
        setuid(), otherwise it won't set the real and saved gids. */
@@ -239,7 +239,7 @@ static void run(int argc, char * * argv)
     else if (command == "get-ownership") {
         /* Syntax: nix-setuid-helper get-ownership <path> */
         if (argc != 3) throw Error("missing path");
-        secureChown(-1, gidBuildUsers, uidNix, gidBuildUsers, argv[2]);
+        secureChown((uid_t) -1, gidBuildUsers, uidNix, gidBuildUsers, argv[2]);
     }
 
     else if (command == "kill") {