1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

systemctl: use the retval of must_be_root()

This commit is contained in:
Mike Yuan 2024-08-17 20:33:12 +02:00
parent 1f9425d1c4
commit 5aa48b6de1
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View File

@ -180,10 +180,9 @@ int halt_main(void) {
return start_with_fallback();
}
if (geteuid() != 0) {
(void) must_be_root();
return -EPERM;
}
r = must_be_root();
if (r < 0)
return r;
if (!arg_no_wtmp) {
if (sd_booted() > 0)