From 30dfe7a11def229df5eb56aa266db3617e2f7834 Mon Sep 17 00:00:00 2001 From: Markus Friedl Date: Fri, 23 Mar 2001 14:28:33 +0000 Subject: ignore SIGPIPE, restore in child, fixes x11-fwd crashes; with djm@ --- usr.bin/ssh/session.c | 6 +++++- usr.bin/ssh/sshd.c | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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 #include @@ -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) { -- cgit v1.2.3