chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
65491fd
)
systemctl: print a nice error message if an unprivileged user calls systemctl reboot -ff
author
Lennart Poettering
<lennart@poettering.net>
Thu, 3 May 2012 14:17:58 +0000
(16:17 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 3 May 2012 14:17:58 +0000
(16:17 +0200)
src/systemctl/systemctl.c
patch
|
blob
|
history
diff --git
a/src/systemctl/systemctl.c
b/src/systemctl/systemctl.c
index e2550adb58edd045c713efd8315d831ba25bba01..cbe6848d0335faf3f73d022207db67b3210289bf 100644
(file)
--- a/
src/systemctl/systemctl.c
+++ b/
src/systemctl/systemctl.c
@@
-1788,6
+1788,11
@@
static int start_special(DBusConnection *bus, char **args) {
a = verb_to_action(args[0]);
a = verb_to_action(args[0]);
+ if (arg_force >= 2 && geteuid() != 0) {
+ log_error("Must be root.");
+ return -EPERM;
+ }
+
if (arg_force >= 2 &&
(a == ACTION_HALT ||
a == ACTION_POWEROFF ||
if (arg_force >= 2 &&
(a == ACTION_HALT ||
a == ACTION_POWEROFF ||