From 1673c373c9ddd1fc7ce1e12c79621dafe13fe930 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 14 Apr 2017 11:57:02 +0200 Subject: nix-daemon: Don't die if the user sends an unknown setting --- src/nix-daemon/nix-daemon.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index 9fcb81dd5..b4e753f55 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -453,10 +453,14 @@ static void performOp(ref 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(); -- cgit v1.2.3