OpenSSH 2.4.0 patch call..

mouring at etoh.eviladmin.org mouring at etoh.eviladmin.org
Sat Dec 30 16:39:51 EST 2000


On Fri, 29 Dec 2000, Damien Miller wrote:

> On Fri, 29 Dec 2000, Damien Miller wrote:
> 
> > > bash-2.04$ uname -a
> > > HP-UX jenny B.11.11 A 9000/800 670359383 two-user license
> > > bash-2.04$ sleep 20& exit
> > > [1] 13064
> > > logout
> > > logout
> > > Connection to jenny closed.
> > > [20 seconds later]
> > 
> > damn - can you strace it to see if/where we are blocking. On Linux we 
> > end up stuck in a read() on a fd which has been explicitly marked 
> > non-blocking, which strikes me as weird.
> 
> Another datapoint: the grandchild processes never receive a HUP. We are
> either messing up on the terminal handling or on the setting up 
> of pgid or sid.
> 
I know this does not solve Protocol 1 hanging, but can you give me a
reason why the following patch won't work for Protocol 2 to hang the
'sleep 30&exit' issue.  It tells OpenSSH to explicitly drain the input
buffers if the output buffers are closed.  (Of course the same trick does
not work under protocol 1 ecause channel_write_fail1() is not called soon
enough.)

- Ben

--- ../openssh/nchan.c	Mon Nov 13 05:57:26 2000
+++ nchan.c	Fri Dec 29 23:19:40 2000
@@ -335,11 +335,13 @@
 	case CHAN_OUTPUT_OPEN:
 		debug("channel %d: output open -> closed", c->self);
 		chan_shutdown_write(c); /* ?? */
+		c->istate = CHAN_INPUT_WAIT_DRAIN;
 		c->ostate = CHAN_OUTPUT_CLOSED;
 		break;
 	case CHAN_OUTPUT_WAIT_DRAIN:
 		debug("channel %d: output drain -> closed", c->self);
 		chan_shutdown_write(c);
+		c->istate = CHAN_INPUT_WAIT_DRAIN;
 		c->ostate = CHAN_OUTPUT_CLOSED;
 		break;
 	default:






More information about the openssh-unix-dev mailing list