diff options
Diffstat (limited to 'sshconnect.c')
-rw-r--r-- | sshconnect.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sshconnect.c b/sshconnect.c index 45ba6ed12..64dc032c4 100644 --- a/sshconnect.c +++ b/sshconnect.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect.c,v 1.230 2010/12/14 11:59:06 markus Exp $ */ | 1 | /* $OpenBSD: sshconnect.c,v 1.231 2011/01/06 23:01:35 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1259,6 +1259,7 @@ ssh_local_cmd(const char *args) | |||
1259 | char *shell; | 1259 | char *shell; |
1260 | pid_t pid; | 1260 | pid_t pid; |
1261 | int status; | 1261 | int status; |
1262 | void (*osighand)(int); | ||
1262 | 1263 | ||
1263 | if (!options.permit_local_command || | 1264 | if (!options.permit_local_command || |
1264 | args == NULL || !*args) | 1265 | args == NULL || !*args) |
@@ -1267,6 +1268,7 @@ ssh_local_cmd(const char *args) | |||
1267 | if ((shell = getenv("SHELL")) == NULL || *shell == '\0') | 1268 | if ((shell = getenv("SHELL")) == NULL || *shell == '\0') |
1268 | shell = _PATH_BSHELL; | 1269 | shell = _PATH_BSHELL; |
1269 | 1270 | ||
1271 | osighand = signal(SIGCHLD, SIG_DFL); | ||
1270 | pid = fork(); | 1272 | pid = fork(); |
1271 | if (pid == 0) { | 1273 | if (pid == 0) { |
1272 | debug3("Executing %s -c \"%s\"", shell, args); | 1274 | debug3("Executing %s -c \"%s\"", shell, args); |
@@ -1279,6 +1281,7 @@ ssh_local_cmd(const char *args) | |||
1279 | while (waitpid(pid, &status, 0) == -1) | 1281 | while (waitpid(pid, &status, 0) == -1) |
1280 | if (errno != EINTR) | 1282 | if (errno != EINTR) |
1281 | fatal("Couldn't wait for child: %s", strerror(errno)); | 1283 | fatal("Couldn't wait for child: %s", strerror(errno)); |
1284 | signal(SIGCHLD, osighand); | ||
1282 | 1285 | ||
1283 | if (!WIFEXITED(status)) | 1286 | if (!WIFEXITED(status)) |
1284 | return (1); | 1287 | return (1); |