mirror of
https://github.com/NixOS/nix.git
synced 2024-11-23 23:32:28 +00:00
Don't let unprivileged users repair paths
This commit is contained in:
parent
7106bb0611
commit
d8ddf994e7
@ -520,13 +520,15 @@ static void performOp(bool trusted, unsigned int clientVersion,
|
||||
break;
|
||||
|
||||
case wopVerifyStore: {
|
||||
bool checkContents = readInt(from) != 0;
|
||||
bool repair = readInt(from) != 0;
|
||||
startWork();
|
||||
bool errors = store->verifyStore(checkContents, repair);
|
||||
stopWork();
|
||||
writeInt(errors, to);
|
||||
break;
|
||||
bool checkContents = readInt(from) != 0;
|
||||
bool repair = readInt(from) != 0;
|
||||
startWork();
|
||||
if (repair && !trusted)
|
||||
throw Error("you are not privileged to repair paths");
|
||||
bool errors = store->verifyStore(checkContents, repair);
|
||||
stopWork();
|
||||
writeInt(errors, to);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user