chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
main: don't try to mount api dirs if we are not root
[elogind.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index d7d3995e1b13a4f4b7cf8cdf3f48828332dc3d13..7a829cea5c793a2fb4235f052e2ea90163f631f0 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-582,8
+582,9
@@
int main(int argc, char *argv[]) {
/* Mount /proc, /sys and friends, so that /proc/cmdline and
* /proc/$PID/fd is available. */
/* Mount /proc, /sys and friends, so that /proc/cmdline and
* /proc/$PID/fd is available. */
- if (mount_setup() < 0)
- goto finish;
+ if (geteuid() == 0)
+ if (mount_setup() < 0)
+ goto finish;
/* Reset all signal handlers. */
assert_se(reset_all_signal_handlers() == 0);
/* Reset all signal handlers. */
assert_se(reset_all_signal_handlers() == 0);