summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index e780177..c9229f3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -393,6 +393,14 @@ main (int argc, char **argv)
exit (EX_SOFTWARE);
}
+ /* Switch to a different user if we're running as root */
+ if (geteuid () == 0) {
+ change_user (argv[0]);
+ } else {
+ log_message (LOG_WARNING,
+ "Not running as root, so not changing UID/GID.");
+ }
+
ret = setup_logging ();
if (ret != 0) {
exit (EX_SOFTWARE);
@@ -438,13 +446,6 @@ main (int argc, char **argv)
exit (EX_OSERR);
}
- /* Switch to a different user if we're running as root */
- if (geteuid () == 0)
- change_user (argv[0]);
- else
- log_message (LOG_WARNING,
- "Not running as root, so not changing UID/GID.");
-
if (child_pool_create () < 0) {
fprintf (stderr,
"%s: Could not create the pool of children.\n",