diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-03-23 14:28:33 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-03-23 14:28:33 +0000 |
commit | 30dfe7a11def229df5eb56aa266db3617e2f7834 (patch) | |
tree | 7136251a3b7760fc3a62c445250e6f1a42594786 /usr.bin | |
parent | dfcecc94343791147d7c74ad65451f73a7db9475 (diff) |
ignore SIGPIPE, restore in child, fixes x11-fwd crashes; with djm@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/session.c | 6 | ||||
-rw-r--r-- | usr.bin/ssh/sshd.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c index 27d3fa9e279..5057dcb71be 100644 --- a/usr.bin/ssh/session.c +++ b/usr.bin/ssh/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.66 2001/03/21 21:06:30 markus Exp $"); +RCSID("$OpenBSD: session.c,v 1.67 2001/03/23 14:28:32 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -1094,6 +1094,10 @@ do_child(Session *s, const char *command) else cp = shell; } + + /* restore SIGPIPE for child */ + signal(SIGPIPE, SIG_DFL); + /* * If we have no command, execute the shell. In this case, the shell * name to be passed in argv[0] is preceded by '-' to indicate that diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index f40e1ba5b36..507a3ab1a9d 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.177 2001/03/23 11:04:07 djm Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.178 2001/03/23 14:28:32 markus Exp $"); #include <openssl/dh.h> #include <openssl/bn.h> @@ -790,6 +790,9 @@ main(int ac, char **av) /* Chdir to the root directory so that the current disk can be unmounted if desired. */ chdir("/"); + + /* ignore SIGPIPE */ + signal(SIGPIPE, SIG_IGN); /* Start listening for a socket, unless started from inetd. */ if (inetd_flag) { |