sshd problem on Solaris 7: Control-C hangs shell

Carson Gaspar carson at taltos.org
Mon Jul 9 20:54:50 EST 2001



--On Monday, July 09, 2001 1:18 PM +0300 Tor Lillqvist 
<Tor.Lillqvist at tellabs.com> wrote:

> Adding some debugging printfs tell me that the read(fdout,...) in
> serverloop.c:process_input() returns zero when I type the Control-C?!
> Some Solaris quirk in pty behaviour related to interrupts in raw mode?
> Following this read returning 0, sshd thinks it got an EOF, closes its
> side of the pty, but the shell still thinks everything is OK, but of
> course can't get any input.

>From the solaris read() man page:

     When attempting to read a file associated  with  a  terminal
     that has no data currently available:

        o  If O_NDELAY is set, read() returns 0.

        o  If O_NONBLOCK is set, read() returns -1 and sets errno
           to EAGAIN.

        o  If O_NDELAY and O_NONBLOCK are  clear,  read()  blocks
           until data become available.

My guess is that:

- O_NDELAY is set
- ^C is causing select to wake up somehow

I'll have to look at the code to see what's going on, and it's too late 
here for me to try and understand the OpenSSH I/O loop. I suspect that 
setting O_NONBLOCK instead of O_NDELAY (or in addition to??) may be a 
work-around.

-- 
Carson Gaspar - carson at taltos.org
Queen Trapped in a Butch Body




More information about the openssh-unix-dev mailing list