hang on exit bug under Linux

Michael michael at bizsystems.com
Tue Dec 11 05:00:44 EST 2001


> On Fri, Dec 07, 2001 at 08:20:55PM -0800, Michael wrote:
> > so what about connections that are made from a script??
> 
> the so-called bug is only related to sessions with ptys.
> 
> you don't use ptys with scripts, so there is no problems
> for scripts.
> 

That's not true. Example:

on the target host running openssh sshd daemon

#!/usr/bin/perl
while(1) {
  sleep 1;
}
# end

on the client, with no password required

#!/bin/sh
/usr/localbin/ssh targethost "/usr/bin/perl tstprog.pl &"
# end

the script hangs and never returns because sshd will not close its 
connection to the client. Seems whenever STDOUT or STDERR may return 
info, sshd will not detach as other programs such as telnet, rsh, 
ssh-1.2x, etc.. are happy to do.

Stick this in your crontab if you want to really screw up your 
machine.

Michael
Michael at Insulin-Pumpers.org



More information about the openssh-unix-dev mailing list