mirror of
https://github.com/rofl0r/proxychains-ng
synced 2025-01-08 06:02:51 +08:00
care about the argv array when the filename is passed
This commit is contained in:
parent
a9df8ecaaa
commit
c377789d14
@ -44,6 +44,7 @@ int main(int argc, char *argv[]) {
|
||||
char buf[256];
|
||||
char pbuf[256];
|
||||
int opt;
|
||||
int start_argv = 1;
|
||||
|
||||
while ((opt = getopt(argc, argv, "fh:")) != -1) {
|
||||
switch (opt) {
|
||||
@ -52,6 +53,11 @@ int main(int argc, char *argv[]) {
|
||||
break;
|
||||
case 'f':
|
||||
path = (char *)optarg;
|
||||
if(!path) {
|
||||
printf("error: no path supplied.");
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
start_argv = 3;
|
||||
break;
|
||||
default: /* '?' */
|
||||
usage(argv);
|
||||
@ -93,7 +99,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
snprintf(buf, sizeof(buf), "LD_PRELOAD=%s/libproxychains.so", LIB_DIR);
|
||||
putenv(buf);
|
||||
execvp(argv[1], &argv[1]);
|
||||
execvp(argv[start_argv], &argv[start_argv]);
|
||||
perror("proxychains can't load process....");
|
||||
|
||||
return EXIT_FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user