From bc8c2f5c549084df93c061b061f1e5b0d9d7046c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 8 Jul 2010 21:31:23 +0200 Subject: [PATCH 1/1] systemctl: short cut things if we aren't root and the user requested a reboot to suppress unnecessary wall message --- src/systemctl.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.30.2