Created
March 4, 2015 06:09
-
-
Save andronoob/047147d3436850a7ff3a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -Nur old/shadowsocks-libev/src/jconf.c new/shadowsocks-libev/src/jconf.c | |
--- old/shadowsocks-libev/src/jconf.c 2015-02-14 08:04:02.000000000 +0000 | |
+++ new/shadowsocks-libev/src/jconf.c 2015-02-27 16:17:37.000000000 +0000 | |
@@ -171,6 +171,8 @@ | |
conf.local_port = to_string(value); | |
} else if (strcmp(name, "password") == 0) { | |
conf.password = to_string(value); | |
+ } else if (strcmp(name, "user") == 0) { | |
+ conf.user = to_string(value); | |
} else if (strcmp(name, "method") == 0) { | |
conf.method = to_string(value); | |
} else if (strcmp(name, "timeout") == 0) { | |
diff -Nur old/shadowsocks-libev/src/jconf.h new/shadowsocks-libev/src/jconf.h | |
--- old/shadowsocks-libev/src/jconf.h 2015-02-14 08:04:02.000000000 +0000 | |
+++ new/shadowsocks-libev/src/jconf.h 2015-02-27 16:15:21.000000000 +0000 | |
@@ -40,6 +40,7 @@ | |
char *local_addr; | |
char *local_port; | |
char *password; | |
+ char *user; | |
char *method; | |
char *timeout; | |
int fast_open; | |
diff -Nur old/shadowsocks-libev/src/server.c new/shadowsocks-libev/src/server.c | |
--- old/shadowsocks-libev/src/server.c 2015-02-14 08:04:02.000000000 +0000 | |
+++ new/shadowsocks-libev/src/server.c 2015-02-27 16:23:15.000000000 +0000 | |
@@ -1156,6 +1156,9 @@ | |
if (password == NULL) { | |
password = conf->password; | |
} | |
+ if (user == NULL) { | |
+ user = conf->user; | |
+ } | |
if (method == NULL) { | |
method = conf->method; | |
} | |
@@ -1297,6 +1300,7 @@ | |
} | |
// setuid | |
+ LOGI("setuid to %s",user); | |
if (user != NULL) { | |
run_as(user); | |
} | |
diff -Nur old/shadowsocks-libev/src/local.c new/shadowsocks-libev/src/local.c | |
--- old/shadowsocks-libev/src/local.c 2015-02-14 08:04:02.000000000 +0000 | |
+++ new/shadowsocks-libev/src/local.c 2015-03-03 14:11:01.922862962 +0000 | |
@@ -981,6 +981,9 @@ | |
if (password == NULL) { | |
password = conf->password; | |
} | |
+ if (user == NULL) { | |
+ user = conf->user; | |
+ } | |
if (method == NULL) { | |
method = conf->method; | |
} | |
diff -Nur old/shadowsocks-libev/src/redir.c new/shadowsocks-libev/src/redir.c | |
--- old/shadowsocks-libev/src/redir.c 2015-02-14 08:04:02.000000000 +0000 | |
+++ new/shadowsocks-libev/src/redir.c 2015-03-03 14:12:04.061318395 +0000 | |
@@ -674,6 +674,9 @@ | |
if (password == NULL) { | |
password = conf->password; | |
} | |
+ if (user == NULL) { | |
+ user = conf->user; | |
+ } | |
if (method == NULL) { | |
method = conf->method; | |
} | |
diff -Nur old/shadowsocks-libev/src/tunnel.c new/shadowsocks-libev/src/tunnel.c | |
--- old/shadowsocks-libev/src/tunnel.c 2015-02-14 08:04:02.000000000 +0000 | |
+++ new/shadowsocks-libev/src/tunnel.c 2015-03-03 14:12:57.787982813 +0000 | |
@@ -728,6 +728,9 @@ | |
if (password == NULL) { | |
password = conf->password; | |
} | |
+ if (user == NULL) { | |
+ user = conf->user; | |
+ } | |
if (method == NULL) { | |
method = conf->method; | |
} | |
diff -Nur old/shadowsocks-libev/src/utils.c new/shadowsocks-libev/src/utils.c | |
--- old/shadowsocks-libev/src/utils.c 2015-02-14 08:04:02.000000000 +0000 | |
+++ new/shadowsocks-libev/src/utils.c 2015-02-27 16:24:41.000000000 +0000 | |
@@ -257,6 +257,9 @@ | |
" only available in server mode\n"); | |
printf("\n"); | |
printf( | |
+ " [-a <user>] username to run as\n"); | |
+ printf("\n"); | |
+ printf( | |
" [--fast-open] enable TCP fast open,\n"); | |
printf( | |
" only available on Linux kernel > 3.7.0\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment