[openssh] Re: SNAP-2000082900

Tobias Oetiker oetiker at ee.ethz.ch
Wed Aug 30 17:22:20 EST 2000


Today you sent me mail regarding [openssh] Re: SNAP-2000082900:

*> On Tue, 29 Aug 2000, Tobias Oetiker wrote:
*> 
*> > earlier I wrote that the 'connection dies on exit of x11 forwarded 
*> > motif application' bug was solved with this release ...
*> > unfortunately further testing showed that it just did not occur on
*> > the machine I tested. All our other machines still show it ... 
*>  
*> Are there any error messages in the client or server logs when this
*> happens?

OK ... this issue is realy getting to me ... so I debugged it ... 
here is the patch ... the problem seems to be that the motif app
exists so fast that it is already gone when sshd still tries to
send data to the remote xserver or something of that ilk ... 
probably the error is somewhere deeper inside the x11 forwarding
code as I expect the remote ssh should actually tell the sshd that
a channel has been closed ... 

--- channels.c.orig     Wed Aug 30 07:42:11 2000
+++ channels.c  Wed Aug 30 08:09:30 2000
@@ -686,9 +686,17 @@
        if (c->wfd != -1 &&
            FD_ISSET(c->wfd, writeset) &&
            buffer_len(&c->output) > 0) {
+               void *oldhandler;
+               int errsave;
+               /* maybe the other end is dead so we would get SIGPIPE
+                  which would be fatal. We don't want this, so lets
+                  ignore it for now and reset the handler afterwards */
+                oldhandler = signal (SIGPIPE, SIG_IGN);
                len = write(c->wfd, buffer_ptr(&c->output),
                    buffer_len(&c->output));
-               if (len < 0 && (errno == EINTR || errno == EAGAIN))
+                errsave = errno;
+                       signal (SIGPIPE, oldhandler);
+               if (len < 0 && (errsave == EINTR || errsave == EAGAIN || errsave==EPIPE))
                        return 1;
                if (len <= 0) {
                        if (compat13) {

cheers
tobi

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker, Timelord & SysMgr @ EE-Dept ETH-Zurich
 / // _ \/ _ \/ / TEL: +41(0)1-6325286  FAX:...1517  ICQ: 10419518 
/_/ \.__/_.__/_/ oetiker at ee.ethz.ch http://ee-staff.ethz.ch/~oetiker






More information about the openssh-unix-dev mailing list