summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-08 21:31:23 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-08 21:36:40 +0200
commitbc8c2f5c549084df93c061b061f1e5b0d9d7046c (patch)
tree6d0f2b61d700c8db800ab486509379f9734decee
parentd47b555bb6cabca024242e00b674da835938d286 (diff)
systemctl: short cut things if we aren't root and the user requested a reboot to suppress unnecessary wall message
-rw-r--r--src/systemctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 01deafe2a1..0314337903 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);