TIOCSCTTY problem/fix

Frank Adelstein frank at MyCause.com
Thu Apr 3 08:04:48 EST 2003


Perhaps this is a known problem, but I only found one instance of someone
describing it on the net with no follow-up.  I just installed openssh 
(3.6p1) on a linux system (running an old 2.0.34 kernel) with privilege 
separation disabled and get the following messages in /var/log/messages:

Apr  2 15:48:34 ernestine sshd[6153]: error: ioctl(TIOCSCTTY): Operation not permitted
Apr  2 15:48:34 ernestine sshd[6153]: error: open /dev/tty failed - could not set controlling tty: Device not configured

The effect is that ^Z's are mostly ignored (but not by vi) and ^C kills
the session, rather than a running program.

After poking around the net and the code a bit, I found that changing line
318 in sshpty.c from:

        if (ioctl(*ttyfd, TIOCSCTTY, NULL) < 0)
to
        if (ioctl(*ttyfd, TIOCSCTTY, 1) < 0)

seems to fix things.  Is this a known bug or something peculiar to my
installation?  Let me know if there is any further information I can 
provide.  Thanks for any input.

--Frank.




More information about the openssh-unix-dev mailing list