Don't let unprivileged users repair paths
This commit is contained in:
parent
715478fe09
commit
e531520ddc
|
@ -648,13 +648,15 @@ static void performOp(bool trusted, unsigned int clientVersion,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wopVerifyStore: {
|
case wopVerifyStore: {
|
||||||
bool checkContents = readInt(from) != 0;
|
bool checkContents = readInt(from) != 0;
|
||||||
bool repair = readInt(from) != 0;
|
bool repair = readInt(from) != 0;
|
||||||
startWork();
|
startWork();
|
||||||
bool errors = store->verifyStore(checkContents, repair);
|
if (repair && !trusted)
|
||||||
stopWork();
|
throw Error("you are not privileged to repair paths");
|
||||||
writeInt(errors, to);
|
bool errors = store->verifyStore(checkContents, repair);
|
||||||
break;
|
stopWork();
|
||||||
|
writeInt(errors, to);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue