grantpt() not the problem... sia_ses_init complaining about it's *own* terminal

Toni L. Harbaugh-Blackford harbaugh at
Sat Aug 31 03:18:05 EST 2002


HAVE_DEV_PTMX and grantpt() *do* work to set the modes on the tty.  But that
is *not* the terminal that sia_ses_init() is complaining about.  It is
complaining about the terminal in which *it* is running.

When privsep is off, the ttyname of file descriptors 0 and 1 matches that passed
setup_sia(), and output goes to the client:

     debug3: tty_make_modes: 92 0
     debug3: tty_make_modes: 93 0
     debug1: channel request 0: shell
     debug1: fd 3 setting TCP_NODELAY
     debug2: callback done
     debug1: channel 0: open confirm rwindow 0 rmax 32768
     debug2: channel 0: rcvd adjust 131072
     debug3: do_child before PRIVSEP setup_sia euid=0,egid=1,ttyfd=12
      in setup_sia, passed tty owner = 0
      in setup_sia, passed tty=/dev/pts/3, ttyname(0)=/dev/pts/3, ttyname(1) = /dev/pts/3
     Last   successful login for harbaugh: Fri Aug 30 12:41:22 EDT 2002 from
     Last unsuccessful login for harbaugh: Fri Aug 30 10:55:56 EDT 2002 from
     Compaq Tru64 UNIX V5.1A (Rev. 1885); Fri Aug 23 13:12:42 EDT 2002
     On Wed Nov 21 14:03:06 EST 2001 your system was successfully updated from:

However, when privsep is on, there is no ttyname associated descriptor 0, and
descriptor 1 is device with a different name (output goes to the server side)

     debug1: server_input_channel_req: channel 0 request shell reply 0
     debug1: session_by_channel: session 0 channel 0
     debug1: session_input_channel_req: session 0 req shell
     debug1: fd 5 setting TCP_NODELAY
     debug3: mm_answer_pty: tty /dev/pts/3 ptyfd 4
     debug3: mm_request_receive entering
     debug1: Setting controlling tty using TIOCSCTTY.
     debug3: monitor_read: checking request 38
      in setup_sia, passed tty owner = 0
      in setup_sia, passed tty=/dev/pts/3, ttyname(0)=(null), ttyname(1) = /dev/pts/2
     debug1: channel 0: rfd 13 isatty
     debug1: fd 13 setting O_NONBLOCK
     debug2: fd 12 is O_NONBLOCK
     Error in terminal setup.
     Couldn't establish session for harbaugh from
     debug1: Calling cleanup 0x12005627c(0x140031fb0)
     debug1: session_pty_cleanup: session 0 release /dev/pts/3

But I don't know specifically what aspect of this tty configuration
sia_ses_init() doesn't like.  It could be that sia_ses_init() does not
allow input from a non-tty, or that the tty of descriptor 0 does match
that of descriptor 1.  I remember hearing of restrictions on the terminal
in which sia_ses_init is called, but I don't remember what they are.

Anyone have further insight on this?

Toni Harbaugh-Blackford                     harbaugh at
AlphaServer 8400 System Administrator
SAIC/NCI Frederick Advanced Biomedical Computing Center

More information about the openssh-unix-dev mailing list