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 [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message

Reply via email to