Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

fix password issue #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pytest/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"server":"localhost",
"server_port":8888,
"local_port":1080,
"password":"foobar!",
"password":"barfoo!",
"timeout":60
}
2 changes: 1 addition & 1 deletion pytest/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import string
from subprocess import Popen, PIPE

p1 = Popen(['../server'], shell=False, bufsize=0, stdin=PIPE,
p1 = Popen(['../server', '-k', 'barfoo!'], shell=False, bufsize=0, stdin=PIPE,
stdout=PIPE, stderr=PIPE, close_fds=True)
p2 = Popen(['python', 'local.py'], shell=False, bufsize=0, stdin=PIPE,
stdout=PIPE, stderr=PIPE, close_fds=True)
Expand Down
3 changes: 2 additions & 1 deletion server.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ int main(int argc, char *argv[])
server_port = atoi(optarg);
break;
case 'k':
password = (uint8_t *)optarg;
password = malloc(strlen(optarg + 1));
strcpy((char *)password, optarg);
break;
case 'f':
pid_path = optarg;
Expand Down