OpenSSH 2.3.0p1: Broken pipe / SIGPIPE
Andreas M. Kirchwitz
amk at krell.zikzak.de
Wed Dec 13 14:30:31 EST 2000
Damien Miller wrote:
> Index: session.c
> ===================================================================
> RCS file: /cvs/openssh_cvs/session.c,v
> retrieving revision 1.58
> diff -u -r1.58 session.c
> --- session.c 2000/11/29 04:55:17 1.58
> +++ session.c 2000/12/12 23:24:37
> @@ -480,8 +480,6 @@
> if (s == NULL)
> fatal("do_exec_no_pty: no session");
>
> - signal(SIGPIPE, SIG_DFL);
> -
> session_proctitle(s);
>
> #ifdef USE_PAM
> @@ -493,6 +491,8 @@
> /* Child. Reinitialize the log since the pid has changed. */
> log_init(__progname, options.log_level, options.log_facility, log_stderr);
>
> + signal(SIGPIPE, SIG_DFL);
> +
> /*
> * Create a new session and process group since the 4.4BSD
> * setlogin() affects the entire process group.
> @@ -605,6 +605,8 @@
> if ((pid = fork()) == 0) {
> /* Child. Reinitialize the log because the pid has changed. */
> log_init(__progname, options.log_level, options.log_facility, log_stderr);
> +
> + signal(SIGPIPE, SIG_DFL);
>
> /* Close the master side of the pseudo tty. */
> close(ptyfd);
>
> Does this patch help?
YEAH! That looks very good! Couldn't see any bad side effects
so far with this patch. It successfully solves the "Broken pipe"
problem with OpenSSH 2.3.0p1. "yes | head -1" now works again
as expected with tcsh and bash.
Great! Thanks a lot for your help...
Btw, will this patch go into the official OpenSSH(p) distribution?
Greetings, Andreas
More information about the openssh-unix-dev
mailing list