Prevent accidental recursive Nix

This commit is contained in:
Eelco Dolstra 2018-02-07 19:07:38 +01:00
parent 48c192ca2d
commit 88b5d0c8e8
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -994,7 +994,7 @@ static void daemonLoop(char * * argv)
if (matchUser(user, group, trustedUsers))
trusted = true;
if (!trusted && !matchUser(user, group, allowedUsers))
if ((!trusted && !matchUser(user, group, allowedUsers)) || group == "nixbld")
throw Error(format("user '%1%' is not allowed to connect to the Nix daemon") % user);
printInfo(format((string) "accepted connection from pid %1%, user %2%" + (trusted ? " (trusted)" : ""))