From: Lennart Poettering Date: Thu, 8 Jul 2010 19:31:23 +0000 (+0200) Subject: systemctl: short cut things if we aren't root and the user requested a reboot to... X-Git-Tag: v2~11 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=bc8c2f5c549084df93c061b061f1e5b0d9d7046c systemctl: short cut things if we aren't root and the user requested a reboot to suppress unnecessary wall message --- diff --git a/src/systemctl.c b/src/systemctl.c index 01deafe2a..031433790 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -3156,6 +3156,11 @@ static int start_with_fallback(DBusConnection *bus) { static int halt_main(DBusConnection *bus) { int r; + if (geteuid() != 0) { + log_error("Must to be root."); + return -EPERM; + } + if (!arg_dry && !arg_immediate) return start_with_fallback(bus);