X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemctl.c;h=03143379030cf2d7e10213a6fc071dfe8d530262;hp=01deafe2a13b1d0edc3bcfe8633343ccc1eab471;hb=bc8c2f5c549084df93c061b061f1e5b0d9d7046c;hpb=d47b555bb6cabca024242e00b674da835938d286 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);