Browse Source

Fix #954

pull/957/head
Max Lv 8 years ago
parent
commit
6d9331a56d
5 changed files with 6 additions and 6 deletions
  1. 2
      src/local.c
  2. 4
      src/manager.c
  3. 2
      src/redir.c
  4. 2
      src/server.c
  5. 2
      src/tunnel.c

2
src/local.c

@ -1443,7 +1443,7 @@ main(int argc, char **argv)
if (user != NULL && ! run_as(user)) {
FATAL("failed to switch user");
}
if (geteuid() == 0){
if (getuid() == 0){
LOGI("You are running this process as the root user!");
}

4
src/manager.c

@ -848,11 +848,11 @@ main(int argc, char **argv)
if (user != NULL && ! run_as(user)) {
FATAL("failed to switch user");
}
if (geteuid() == 0){
if (getuid() == 0){
LOGI("You are running this process as the root user!");
}
struct passwd *pw = getpwuid(geteuid());
struct passwd *pw = getpwuid(getuid());
const char *homedir = pw->pw_dir;
working_dir_size = strlen(homedir) + 15;
working_dir = malloc(working_dir_size);

2
src/redir.c

@ -1024,7 +1024,7 @@ main(int argc, char **argv)
if (user != NULL && ! run_as(user)) {
FATAL("failed to switch user");
}
if (geteuid() == 0){
if (getuid() == 0){
LOGI("You are running this process as the root user!");
}

2
src/server.c

@ -1873,7 +1873,7 @@ main(int argc, char **argv)
if (user != NULL && ! run_as(user)) {
FATAL("failed to switch user");
}
if (geteuid() == 0){
if (getuid() == 0){
LOGI("You are running this process as the root user!");
}

2
src/tunnel.c

@ -1031,7 +1031,7 @@ main(int argc, char **argv)
if (user != NULL && ! run_as(user)) {
FATAL("failed to switch user");
}
if (geteuid() == 0){
if (getuid() == 0){
LOGI("You are running this process as the root user!");
}

Loading…
Cancel
Save