nix-daemon: Don't die if the user sends an unknown setting

This commit is contained in:
Eelco Dolstra 2017-04-14 11:57:02 +02:00
parent 872ba75d8b
commit 1673c373c9
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -453,10 +453,14 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe
for (unsigned int i = 0; i < n; i++) {
string name = readString(from);
string value = readString(from);
if (name == "build-timeout")
settings.set(name, value);
else
settings.set(trusted ? name : "untrusted-" + name, value);
try {
if (name == "build-timeout")
settings.set(name, value);
else
settings.set(trusted ? name : "untrusted-" + name, value);
} catch (UsageError & e) {
warn(e.what());
}
}
}
startWork();