sshd hangs on logout -- is this a bug?

Markus Friedl markus at openbsd.org
Wed Sep 12 20:57:32 EST 2001


On Mon, Sep 10, 2001 at 06:14:44PM -0000, John Bowman wrote:
> --- openssh-2.9p2/session.c	Sat Jun 16 21:40:51 2001
> +++ openssh-2.9p2J2/session.c	Tue Jun 19 03:27:30 2001
> @@ -1928,6 +1928,9 @@
>  	 */
>  	if (c->ostate != CHAN_OUTPUT_CLOSED)
>  		chan_write_failed(c);
> +	if (c->istate == CHAN_INPUT_OPEN && compat20) {
> +		chan_shutdown_read(c);
> +	}
>  	s->chanid = -1;

^^^ i still think this is very very wrong.

see the comment:

        /*
         * emulate a write failure with 'chan_write_failed', nobody will be
         * interested in data we write.
         * Note that we must not call 'chan_read_failed', since there could
         * be some more data waiting in the pipe.
         */

you cannot shutdown the pipe, since you did not get an EOF
if istate == CHAN_INPUT_OPEN, so you might loose data. if you
don't loose data on linux than it's a timing/luck issue.



More information about the openssh-unix-dev mailing list