version 1.326, 2020/01/22 07:38:30 |
version 1.327, 2020/01/23 07:10:22 |
|
|
|
|
/* Execute the proxy command. Note that we gave up any |
/* Execute the proxy command. Note that we gave up any |
extra privileges above. */ |
extra privileges above. */ |
signal(SIGPIPE, SIG_DFL); |
ssh_signal(SIGPIPE, SIG_DFL); |
execv(argv[0], argv); |
execv(argv[0], argv); |
perror(argv[0]); |
perror(argv[0]); |
exit(1); |
exit(1); |
|
|
if ((shell = getenv("SHELL")) == NULL || *shell == '\0') |
if ((shell = getenv("SHELL")) == NULL || *shell == '\0') |
shell = _PATH_BSHELL; |
shell = _PATH_BSHELL; |
|
|
osighand = signal(SIGCHLD, SIG_DFL); |
osighand = ssh_signal(SIGCHLD, SIG_DFL); |
pid = fork(); |
pid = fork(); |
if (pid == 0) { |
if (pid == 0) { |
signal(SIGPIPE, SIG_DFL); |
ssh_signal(SIGPIPE, SIG_DFL); |
debug3("Executing %s -c \"%s\"", shell, args); |
debug3("Executing %s -c \"%s\"", shell, args); |
execl(shell, shell, "-c", args, (char *)NULL); |
execl(shell, shell, "-c", args, (char *)NULL); |
error("Couldn't execute %s -c \"%s\": %s", |
error("Couldn't execute %s -c \"%s\": %s", |
|
|
while (waitpid(pid, &status, 0) == -1) |
while (waitpid(pid, &status, 0) == -1) |
if (errno != EINTR) |
if (errno != EINTR) |
fatal("Couldn't wait for child: %s", strerror(errno)); |
fatal("Couldn't wait for child: %s", strerror(errno)); |
signal(SIGCHLD, osighand); |
ssh_signal(SIGCHLD, osighand); |
|
|
if (!WIFEXITED(status)) |
if (!WIFEXITED(status)) |
return (1); |
return (1); |