chiark / gitweb /
systemctl: short cut things if we aren't root and the user requested a reboot to...
authorLennart Poettering <lennart@poettering.net>
Thu, 8 Jul 2010 19:31:23 +0000 (21:31 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 8 Jul 2010 19:36:40 +0000 (21:36 +0200)
src/systemctl.c

index 01deafe..0314337 100644 (file)
@@ -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);