summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMukund Sivaraman <muks@banu.com>2010-04-21 20:10:56 +0530
committerMukund Sivaraman <muks@banu.com>2010-04-21 20:10:56 +0530
commitd30ee746a7e2f0bea365ab7cf99bcc82bd020acc (patch)
treea1b2986432f38b2c3b335197b25dfe7083d8e799 /src
parent1e0ad98f7f16c9159969adee466de94cbf432470 (diff)
downloadtinyproxy-d30ee746a7e2f0bea365ab7cf99bcc82bd020acc.tar.gz
tinyproxy-d30ee746a7e2f0bea365ab7cf99bcc82bd020acc.zip
Revert "main: drop privileges right after reading the config"
This reverts commit 7a9abc2a04dd8ed1f113aa9c803af24adfb22773. It should fix the issue in bug #87.
Diffstat (limited to 'src')
-rw-r--r--src/main.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 2bd2cdb..064b440 100644
--- a/src/main.c
+++ b/src/main.c
@@ -393,14 +393,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);
@@ -446,6 +438,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",