diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-01-18 16:46:37 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-05-08 11:51:51 +0200 |
commit | ded3a403016494a3e01b6de2f4ed14dde78a62b4 (patch) | |
tree | aa62edc1a50daa5eab683e5253d67849219d12cf /src/boot | |
parent | 569ad251adde02dc0915758fe027e0346e50738a (diff) | |
download | systemd-ded3a403016494a3e01b6de2f4ed14dde78a62b4.tar.gz systemd-ded3a403016494a3e01b6de2f4ed14dde78a62b4.tar.bz2 systemd-ded3a403016494a3e01b6de2f4ed14dde78a62b4.zip |
bless-boot: drop must_be_root() checks
If we lack permissions, we will fail anyway. But by not doing the artifial
check, we get more information. For example, on my machine, I see
$ build/systemd-bless-boot good
Not booted with boot counting in effect.
while "Need to be root" is actually untrue, because being root doesn't change
the outcome in any way.
Letting the operation fail on the actual error makes it easier to do test runs:
we *know* the command will fail, but we want to see what the first step would
be.
Not doing the articial check makes it also easier to do create alternative
security arrangements, for example where the directories are mounted with
special ownership mode and an otherwise unprivileged user can perform certain
operations.
Diffstat (limited to 'src/boot')
-rw-r--r-- | src/boot/bless-boot.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/boot/bless-boot.c b/src/boot/bless-boot.c index b5d110f422..f2d033fc40 100644 --- a/src/boot/bless-boot.c +++ b/src/boot/bless-boot.c @@ -480,13 +480,12 @@ exists: } static int run(int argc, char *argv[]) { - static const Verb verbs[] = { - { "help", VERB_ANY, VERB_ANY, 0, help }, - { "status", VERB_ANY, 1, VERB_DEFAULT, verb_status }, - { "good", VERB_ANY, 1, VERB_MUST_BE_ROOT, verb_set }, - { "bad", VERB_ANY, 1, VERB_MUST_BE_ROOT, verb_set }, - { "indeterminate", VERB_ANY, 1, VERB_MUST_BE_ROOT, verb_set }, + { "help", VERB_ANY, VERB_ANY, 0, help }, + { "status", VERB_ANY, 1, VERB_DEFAULT, verb_status }, + { "good", VERB_ANY, 1, 0, verb_set }, + { "bad", VERB_ANY, 1, 0, verb_set }, + { "indeterminate", VERB_ANY, 1, 0, verb_set }, {} }; |