SSH connection hanging on logout

Markus Friedl markus.friedl at informatik.uni-erlangen.de
Fri May 18 07:41:44 EST 2001


On Thu, May 17, 2001 at 01:44:50AM -0000, John Bowman wrote:
> Yes, this patch fixes the X hanging bug (test under Protocol 2 on RedHat
> 6.2 linux systems). Thanks!
> 
> I've incorporated it into this latest version of the hang-on-exit patch
> (the latest patch will always be available from
> http://www.math.ualberta.ca/imaging/snfs)
> 
> -- John Bowman
> 
> University of Alberta
> http://www.math.ualberta.ca/~bowman
> 
> 
> diff -ur openssh-2.9p1/channels.c openssh-2.9p1J/channels.c
> --- openssh-2.9p1/channels.c	Tue Apr 17 12:14:35 2001
> +++ openssh-2.9p1J/channels.c	Wed May 16 16:42:53 2001
> @@ -1137,6 +1137,15 @@
>  			continue;
>  		if (ftab[c->type] == NULL)
>  			continue;
> +		if(c->istate == CHAN_INPUT_OPEN && c->rfd == -1) {
> +			int type=c->type;
> +			c->type=SSH_CHANNEL_CLOSED;
> +			if(channel_find_open() == -1)
> +			  	shutdown(packet_get_connection_out(),
> +					 SHUT_RDWR);

^^^^^^^^
	this cannot be correct. you may _not_ shutdown
	the TCP connection. this breaks
		ssh -N -L 1234:hostb:5678 hosta

> +			c->type=type;
> +			continue;
> +		}



More information about the openssh-unix-dev mailing list