From: Lennart Poettering Date: Mon, 24 May 2010 16:59:13 +0000 (+0200) Subject: main: don't try to mount api dirs if we are not root X-Git-Tag: v1~266 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=8efe3c0114758f229273f17944fd6f2952b10c52 main: don't try to mount api dirs if we are not root --- diff --git a/src/main.c b/src/main.c index d7d3995e1..7a829cea5 100644 --- 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. */ - 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);