From de71cda07824ec31b5ad2965879fab123d743708 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Sat, 24 Mar 2001 00:43:26 +0000 Subject: [PATCH] - markus@cvs.openbsd.org 2001/03/23 14:28:32 [session.c sshd.c] ignore SIGPIPE, restore in child, fixes x11-fwd crashes; with djm@ --- ChangeLog | 5 ++++- session.c | 6 +++++- sshd.c | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6c61cbe66..f465d5d10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,9 @@ - markus@cvs.openbsd.org 2001/03/23 13:10:57 [sftp-int.c] fix put, upload to _absolute_ path, ok djm@ + - markus@cvs.openbsd.org 2001/03/23 14:28:32 + [session.c sshd.c] + ignore SIGPIPE, restore in child, fixes x11-fwd crashes; with djm@ 20010323 - OpenBSD CVS Sync @@ -4701,4 +4704,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1013 2001/03/24 00:39:12 mouring Exp $ +$Id: ChangeLog,v 1.1014 2001/03/24 00:43:26 mouring Exp $ diff --git a/session.c b/session.c index 3ec97d0d1..13fe01870 100644 --- a/session.c +++ b/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" @@ -1427,6 +1427,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/sshd.c b/sshd.c index a12e9211f..0ac78cbaf 100644 --- a/sshd.c +++ b/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 @@ -809,6 +809,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) {