=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshconnect.c,v retrieving revision 1.230 retrieving revision 1.231 diff -u -r1.230 -r1.231 --- src/usr.bin/ssh/sshconnect.c 2010/12/14 11:59:06 1.230 +++ src/usr.bin/ssh/sshconnect.c 2011/01/06 23:01:35 1.231 @@ -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 * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1233,6 +1233,7 @@ char *shell; pid_t pid; int status; + void (*osighand)(int); if (!options.permit_local_command || args == NULL || !*args) @@ -1241,6 +1242,7 @@ 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 @@ 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);