Force per-user group to a known value

This commit is contained in:
Eelco Dolstra
2019-10-09 23:35:02 +02:00
parent 9277e72cb0
commit 20eec802ff
+1 -1
View File
@@ -1443,7 +1443,7 @@ void LocalStore::createUser(const std::string & userName, uid_t userId)
createDirs(dir);
if (chmod(dir.c_str(), 0755) == -1)
throw SysError("changing permissions of directory '%s'", dir);
if (chown(dir.c_str(), userId, -1) == -1)
if (chown(dir.c_str(), userId, 0) == -1)
throw SysError("changing owner of directory '%s'", dir);
}
}