From 2b7c487b091208ad84e1e7a05cd33eb686d9c7a2 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Wed, 16 Nov 2016 14:38:23 +0800 Subject: [PATCH] Refine #954 --- src/local.c | 3 +++ src/redir.c | 1 + src/server.c | 3 +++ src/tunnel.c | 3 +++ 4 files changed, 10 insertions(+) diff --git a/src/local.c b/src/local.c index 52e1d966..7c6d4844 100644 --- a/src/local.c +++ b/src/local.c @@ -1443,9 +1443,12 @@ main(int argc, char **argv) if (user != NULL && ! run_as(user)) { FATAL("failed to switch user"); } + +#ifndef __MINGW32__ if (getuid() == 0){ LOGI("You are running this process as the root user!"); } +#endif // Init connections cork_dllist_init(&connections); diff --git a/src/redir.c b/src/redir.c index 17b7a809..8d25b6c5 100644 --- a/src/redir.c +++ b/src/redir.c @@ -1024,6 +1024,7 @@ main(int argc, char **argv) if (user != NULL && ! run_as(user)) { FATAL("failed to switch user"); } + if (getuid() == 0){ LOGI("You are running this process as the root user!"); } diff --git a/src/server.c b/src/server.c index 3ee662d0..d69416bb 100644 --- a/src/server.c +++ b/src/server.c @@ -1873,9 +1873,12 @@ main(int argc, char **argv) if (user != NULL && ! run_as(user)) { FATAL("failed to switch user"); } + +#ifndef __MINGW32__ if (getuid() == 0){ LOGI("You are running this process as the root user!"); } +#endif // init block list init_block_list(); diff --git a/src/tunnel.c b/src/tunnel.c index bac3e811..ba36b68f 100644 --- a/src/tunnel.c +++ b/src/tunnel.c @@ -1031,9 +1031,12 @@ main(int argc, char **argv) if (user != NULL && ! run_as(user)) { FATAL("failed to switch user"); } + +#ifndef __MINGW32__ if (getuid() == 0){ LOGI("You are running this process as the root user!"); } +#endif ev_run(loop, 0);