systemctl: print a nice error message if an unprivileged user calls systemctl reboot -ff

This commit is contained in:
Lennart Poettering
2012-05-03 16:17:58 +02:00
parent 65491fd8c9
commit c32b90dec7
+5
View File
@@ -1788,6 +1788,11 @@ static int start_special(DBusConnection *bus, char **args) {
a = verb_to_action(args[0]);
if (arg_force >= 2 && geteuid() != 0) {
log_error("Must be root.");
return -EPERM;
}
if (arg_force >= 2 &&
(a == ACTION_HALT ||
a == ACTION_POWEROFF ||