Date: Sat, 3 Mar 2001 19:49:48 -0800 From: Don Lewis <Don.Lewis@tsc.tdk.com> To: Mike Tancsa <mike@sentex.net>, Don Lewis <Don.Lewis@tsc.tdk.com>, Cy Schubert - ITSD Open Systems Group <Cy.Schubert@uumail.gov.bc.ca>, green@FreeBSD.org, kris@FreeBSD.org Cc: stable@FreeBSD.org Subject: Re: more strange problem with broken pipes and ssh Message-ID: <200103040349.TAA25614@salsa.gv.tsc.tdk.com> In-Reply-To: <4.2.2.20010303223335.01e487d8@marble.sentex.net> References: <200103021433.f22EXHS61992@cwsys.cwsent.com> <200103021433.f22EXHS61992@cwsys.cwsent.com> <4.2.2.20010303223335.01e487d8@marble.sentex.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 3, 10:35pm, Mike Tancsa wrote: } Subject: Re: more strange problem with broken pipes and ssh } At 07:18 PM 3/3/2001 -0800, Don Lewis wrote: } >I believe the fix is to call "signal(SIGPIPE, SIG_DFL)" in do_exec_pty() } >in session.c. } } Well, I just popped this in the function, and it worked! Thank you very } much for validating and fixing this most annoying problem! } } ---Mike I'm also wondering of the signal(SIGPIPE, SIG_DFL) in do_exec_no_pty(), which is a FreeBSD addition, might be misplaced. I think it shouldn't be called until after the fork(). Here's a slightly different patch which removes the signal() call from do_exec_no_pty() and adds it to do_child(), which handles the child process for both do_exec_no_pty() and do_exec_pty(). Index: crypto/openssh/session.c =================================================================== RCS file: /home/ncvs/src/crypto/openssh/session.c,v retrieving revision 1.4.2.7 diff -u -u -r1.4.2.7 session.c --- crypto/openssh/session.c 2001/02/04 20:21:06 1.4.2.7 +++ crypto/openssh/session.c 2001/03/04 03:36:26 @@ -448,8 +448,6 @@ if (s == NULL) fatal("do_exec_no_pty: no session"); - signal(SIGPIPE, SIG_DFL); - session_proctitle(s); #ifdef USE_PAM @@ -972,6 +970,9 @@ extern char **environ; struct stat st; char *argv[10]; + + /* Allow the child processes to receive SIGPIPE */ + signal(SIGPIPE, SIG_DFL); /* login(1) is only called if we execute the login shell */ if (options.use_login && command != NULL) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103040349.TAA25614>