summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
authordjm <djm>2011-01-06 23:02:52 +0000
committerdjm <djm>2011-01-06 23:02:52 +0000
commit5b7dbc9032373fb2bef9dac52034e9195e2686a6 (patch)
tree8ebddc0fb440b88e29ac07ee6106779b7dbea4be /sshconnect.c
parentc559185638e086e090c2a1d6f56d6a4e5f3cbfcd (diff)
downloadopenssh-5b7dbc9032373fb2bef9dac52034e9195e2686a6.tar.gz
- djm@cvs.openbsd.org 2011/01/06 23:01:35
[sshconnect.c] reset SIGCHLD handler to SIG_DFL when execuring LocalCommand; ok markus@
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sshconnect.c b/sshconnect.c
index 45ba6ed1..64dc032c 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.230 2010/12/14 11:59:06 markus Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.231 2011/01/06 23:01:35 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1259,6 +1259,7 @@ ssh_local_cmd(const char *args)
char *shell;
pid_t pid;
int status;
+ void (*osighand)(int);
if (!options.permit_local_command ||
args == NULL || !*args)
@@ -1267,6 +1268,7 @@ ssh_local_cmd(const char *args)
if ((shell = getenv("SHELL")) == NULL || *shell == '\0')
shell = _PATH_BSHELL;
+ osighand = signal(SIGCHLD, SIG_DFL);
pid = fork();
if (pid == 0) {
debug3("Executing %s -c \"%s\"", shell, args);
@@ -1279,6 +1281,7 @@ ssh_local_cmd(const char *args)
while (waitpid(pid, &status, 0) == -1)
if (errno != EINTR)
fatal("Couldn't wait for child: %s", strerror(errno));
+ signal(SIGCHLD, osighand);
if (!WIFEXITED(status))
return (1);