From b37135524d31be2f919816e7bb23c57a0d96a558 Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Wed, 21 Apr 2010 20:09:20 +0530 Subject: [PATCH] Revert "main: drop privileges right after reading the config" This reverts commit 965664798c0ef6060735aac56460878c6b0d2cc1. It should fix the issue in bug #87. --- src/main.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.c b/src/main.c index 19ccd54..b933f68 100644 --- a/src/main.c +++ b/src/main.c @@ -374,14 +374,6 @@ 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); @@ -427,6 +419,13 @@ 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",