From 25c8dd240bb9b74de617d0cf96b20ad9c8552c5f Mon Sep 17 00:00:00 2001 From: djm Date: Fri, 1 Jul 2022 00:36:30 +0000 Subject: [PATCH] ignore SIGPIPE earlier in main(), specifically before muxclient() which performs operations that could cause one; Reported by Noam Lewis via bz3454, ok dtucker@ --- usr.bin/ssh/ssh.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index d747df93ea4..a926cc00794 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.574 2022/03/30 04:33:09 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.575 2022/07/01 00:36:30 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1103,6 +1103,8 @@ main(int ac, char **av) } } + ssh_signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE early */ + /* * Initialize "log" output. Since we are the client all output * goes to stderr unless otherwise specified by -y or -E. @@ -1631,7 +1633,6 @@ main(int ac, char **av) options.num_system_hostfiles); tilde_expand_paths(options.user_hostfiles, options.num_user_hostfiles); - ssh_signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE early */ ssh_signal(SIGCHLD, main_sigchld_handler); /* Log into the remote system. Never returns if the login fails. */ -- 2.20.1