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:
d47b555
)
systemctl: short cut things if we aren't root and the user requested a reboot to...
author
Lennart Poettering
<lennart@poettering.net>
Thu, 8 Jul 2010 19:31:23 +0000
(21:31 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 8 Jul 2010 19:36:40 +0000
(21:36 +0200)
src/systemctl.c
patch
|
blob
|
history
diff --git
a/src/systemctl.c
b/src/systemctl.c
index 01deafe2a13b1d0edc3bcfe8633343ccc1eab471..03143379030cf2d7e10213a6fc071dfe8d530262 100644
(file)
--- 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);