Remove white list option in CLI

This commit is contained in:
Max Lv
2016-09-08 13:06:13 +08:00
parent 02c51c3615
commit 42d9b68dcc
10 changed files with 60 additions and 37 deletions
+9 -9
View File
@@ -1402,11 +1402,14 @@ static void accept_cb(EV_P_ ev_io *w, int revents)
if (acl) {
char *peer_name = get_peer_name(serverfd);
if (peer_name != NULL && acl_match_host(peer_name)) {
if (verbose)
LOGI("Access denied from %s", peer_name);
close(serverfd);
return;
if (peer_name != NULL) {
if ((get_acl_mode() == BLACK_LIST && acl_match_host(peer_name) == 1)
|| (get_acl_mode() == WHITE_LIST && acl_match_host(peer_name) >= 0)) {
if (verbose)
LOGI("Access denied from %s", peer_name);
close(serverfd);
return;
}
}
}
@@ -1461,7 +1464,7 @@ int main(int argc, char **argv)
USE_TTY();
while ((c = getopt_long(argc, argv, "f:s:p:l:k:t:m:b:c:i:d:a:n:huUvAw6",
while ((c = getopt_long(argc, argv, "f:s:p:l:k:t:m:b:c:i:d:a:n:huUvA6",
long_options, &option_index)) != -1) {
switch (c) {
case 0:
@@ -1541,9 +1544,6 @@ int main(int argc, char **argv)
case 'A':
auth = 1;
break;
case 'w':
set_acl_mode(WHITE_LIST);
break;
case '6':
ipv6first = 1;
break;