Daemon: warn when an untrusted user cannot override a setting

In a daemon-based Nix setup, some options cannot be overridden by a
client unless the client's user is considered trusted.

Currently, if an untrusted user tries to override one of those
options, we are silently ignoring it.

This can be pretty confusing in certain situations.

e.g. a user thinks he disabled the sandbox when in reality he did not.

We are now sending a warning message letting know the user some options
have been ignored.

Related to #1761.

This is a cherry-pick of 9e0f5f803f.
The above commit has been reverted by
a59e77d9e5 to prevent spamming warnings
with experimental features, but these are now totally ignored on the
daemon side, so there's no reason for the revert any more.
This commit is contained in:
Félix Baylac-Jacqué 2019-06-08 00:41:19 +02:00 committed by Théophane Hufschmitt
parent 346f92aa4c
commit 40a7929c8e

View file

@ -254,7 +254,7 @@ struct ClientSettings
else if (setSubstituters(settings.substituters)) else if (setSubstituters(settings.substituters))
; ;
else else
debug("ignoring the client-specified setting '%s', because it is a restricted setting and you are not a trusted user", name); warn("ignoring the client-specified setting '%s', because it is a restricted setting and you are not a trusted user", name);
} catch (UsageError & e) { } catch (UsageError & e) {
warn(e.what()); warn(e.what());
} }