From 0b5be78891d3d033b3989d743c8e937913e19b35 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Mon, 4 Feb 2019 08:26:44 +0800 Subject: [PATCH] Revert "Switch user before starting plugin server" --- src/server.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/server.c b/src/server.c index 1a7962fa..e0bcc51e 100644 --- a/src/server.c +++ b/src/server.c @@ -1927,17 +1927,6 @@ main(int argc, char **argv) ev_signal_start(EV_DEFAULT, &sigchld_watcher); #endif -#ifndef __MINGW32__ - // setuid - if (user != NULL && !run_as(user)) { - FATAL("failed to switch user"); - } - - if (geteuid() == 0) { - LOGI("running from root user"); - } -#endif - // setup keys LOGI("initializing ciphers... %s", method); crypto = crypto_init(password, key, method); @@ -2097,6 +2086,17 @@ main(int argc, char **argv) ev_timer_init(&block_list_watcher, block_list_clear_cb, UPDATE_INTERVAL, UPDATE_INTERVAL); ev_timer_start(EV_DEFAULT, &block_list_watcher); +#ifndef __MINGW32__ + // setuid + if (user != NULL && !run_as(user)) { + FATAL("failed to switch user"); + } + + if (geteuid() == 0) { + LOGI("running from root user"); + } +#endif + // init block list init_block_list();