summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2011-01-06 23:01:36 +0000
committerDamien Miller <djm@cvs.openbsd.org>2011-01-06 23:01:36 +0000
commit756dabac196e9b3dee713ed3fecd5708fb392158 (patch)
treea871406ca0560293d788cbf6a77ca3e0d20641d7 /usr.bin/ssh
parent722d78ebbd2b0a01d95ed73cb7fea8b5457151af (diff)
reset SIGCHLD handler to SIG_DFL when execuring LocalCommand;
ok markus@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/sshconnect.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index 15a761e74c7..719389ff91b 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/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
@@ -1233,6 +1233,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)
@@ -1241,6 +1242,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);
@@ -1253,6 +1255,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);