version 1.351, 2021/03/03 21:40:16 |
version 1.352, 2021/04/03 06:18:41 |
|
|
{ |
{ |
char *tmp, *ret, strport[NI_MAXSERV]; |
char *tmp, *ret, strport[NI_MAXSERV]; |
const char *keyalias = options.host_key_alias ? |
const char *keyalias = options.host_key_alias ? |
options.host_key_alias : host_arg; |
options.host_key_alias : host_arg; |
|
|
snprintf(strport, sizeof strport, "%d", port); |
snprintf(strport, sizeof strport, "%d", port); |
xasprintf(&tmp, "exec %s", proxy_command); |
xasprintf(&tmp, "exec %s", proxy_command); |
|
|
argv[2] = command_string; |
argv[2] = command_string; |
argv[3] = NULL; |
argv[3] = NULL; |
|
|
/* Execute the proxy command. Note that we gave up any |
/* |
extra privileges above. */ |
* Execute the proxy command. Note that we gave up any |
|
* extra privileges above. |
|
*/ |
ssh_signal(SIGPIPE, SIG_DFL); |
ssh_signal(SIGPIPE, SIG_DFL); |
execv(argv[0], argv); |
execv(argv[0], argv); |
perror(argv[0]); |
perror(argv[0]); |
|
|
} else if (options.bind_interface != NULL) { |
} else if (options.bind_interface != NULL) { |
if ((r = getifaddrs(&ifaddrs)) != 0) { |
if ((r = getifaddrs(&ifaddrs)) != 0) { |
error("getifaddrs: %s: %s", options.bind_interface, |
error("getifaddrs: %s: %s", options.bind_interface, |
strerror(errno)); |
strerror(errno)); |
goto fail; |
goto fail; |
} |
} |
bindaddrlen = sizeof(bindaddr); |
bindaddrlen = sizeof(bindaddr); |
if (check_ifaddrs(options.bind_interface, ai->ai_family, |
if (check_ifaddrs(options.bind_interface, ai->ai_family, |
ifaddrs, &bindaddr, &bindaddrlen) != 0) { |
ifaddrs, &bindaddr, &bindaddrlen) != 0) { |
logit("getifaddrs: %s: no suitable addresses", |
logit("getifaddrs: %s: no suitable addresses", |
options.bind_interface); |
options.bind_interface); |
goto fail; |
goto fail; |
} |
} |
} |
} |
|
|
/* Turn the command into an argument vector */ |
/* Turn the command into an argument vector */ |
if (argv_split(command_template, &ac, &av) != 0) { |
if (argv_split(command_template, &ac, &av) != 0) { |
error("%s \"%s\" contains invalid quotes", tag, |
error("%s \"%s\" contains invalid quotes", tag, |
command_template); |
command_template); |
goto out; |
goto out; |
} |
} |
if (ac == 0) { |
if (ac == 0) { |