X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsystemctl.c;h=03143379030cf2d7e10213a6fc071dfe8d530262;hb=71a6f7538199f571b92e0c9fbb5819f8ce0e0d20;hp=a9a975ee8188648ceb775d5b3ce0e6e1bc801986;hpb=fa776d8e962da9d90459e2f3e86a2a0c6366ee12;p=elogind.git diff --git a/src/systemctl.c b/src/systemctl.c index a9a975ee8..031433790 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -3156,7 +3156,12 @@ static int start_with_fallback(DBusConnection *bus) { static int halt_main(DBusConnection *bus) { int r; - if (!arg_immediate) + if (geteuid() != 0) { + log_error("Must to be root."); + return -EPERM; + } + + if (!arg_dry && !arg_immediate) return start_with_fallback(bus); if (!arg_no_wtmp)