From 07cd5897f9854e2f835614027dd321ba17910013 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 12 Nov 2001 10:52:03 +1100 Subject: [PATCH] - markus@cvs.openbsd.org 2001/10/24 08:51:35 [clientloop.c ssh.c] ignore SIGPIPE early, makes ssh work if agent dies, netbsd-pr via itojun@ --- ChangeLog | 5 ++++- clientloop.c | 3 +-- ssh.c | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7871d80c..b11fb7c9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ - markus@cvs.openbsd.org 2001/10/24 08:41:20 [ssh.c] remove unused + - markus@cvs.openbsd.org 2001/10/24 08:51:35 + [clientloop.c ssh.c] + ignore SIGPIPE early, makes ssh work if agent dies, netbsd-pr via itojun@ 20011109 - (stevesk) auth-pam.c: use do_pam_authenticate(PAM_DISALLOW_NULL_AUTHTOK) @@ -6817,4 +6820,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1636 2001/11/11 23:51:40 djm Exp $ +$Id: ChangeLog,v 1.1637 2001/11/11 23:52:03 djm Exp $ diff --git a/clientloop.c b/clientloop.c index 0e477bc79..7e6fe269a 100644 --- a/clientloop.c +++ b/clientloop.c @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.84 2001/10/11 15:24:00 markus Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.85 2001/10/24 08:51:35 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -820,7 +820,6 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) signal(SIGINT, signal_handler); signal(SIGQUIT, signal_handler); signal(SIGTERM, signal_handler); - signal(SIGPIPE, SIG_IGN); if (have_pty) signal(SIGWINCH, window_change_handler); diff --git a/ssh.c b/ssh.c index dce7530bb..2984a597f 100644 --- a/ssh.c +++ b/ssh.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.148 2001/10/24 08:41:20 markus Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.149 2001/10/24 08:51:35 markus Exp $"); #include #include @@ -752,6 +752,8 @@ again: options.user_hostfile2 = tilde_expand_filename(options.user_hostfile2, original_real_uid); + signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE early */ + /* Log into the remote system. This never returns if the login fails. */ ssh_login(sensitive_data.keys, sensitive_data.nkeys, host, (struct sockaddr *)&hostaddr, pw);