Bug 540 - sshd [priv] doesn't give shell a tty and is killed by ^C too easily
Summary: sshd [priv] doesn't give shell a tty and is killed by ^C too easily
Status: CLOSED DUPLICATE of bug 536
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: ix86 Linux
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-09 12:52 AEST by Peter Stuge
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Stuge 2003-04-09 12:52:10 AEST
Starting with 3.6 on one of my Linux systems running libc5, the privsep sshd
process, marked with [priv] in the process name, has PPID 1 instead of that of
the parent sshd.  This is probably related to the fact that the [priv] sshd dies
when I hit ^C almost anywhere when logged in.  sshd dies when bash is running,
sshd dies when vi is running but sshd doesn't die when joe is running.  ^C means
exit-without-save in joe, since it's remappable, joe might handle the signals
differently than others.

I bet this issue is related to what Mr. Libove sees on NCR MP-RAS.
Comment 1 Peter Stuge 2003-04-09 13:18:54 AEST
Unable to reproduce with sshd -d.

sshd -d process tree:
30988  ?  S    0:00 sshd -D 
30990  p4 S    0:00  \_ -bash 
31729  p4 S    0:00      \_ sshd: root@ttyp5        
31733  p5 S    0:00          \_ -bash 
31816  p5 R    0:00              \_ ps fx 

sshd -D process tree:
30988  ?  S    0:00 sshd -D 
30990  p4 S    0:00  \_ -bash 
31825  p4 S    0:00      \_ openssh-3.6.1p1/sshd -D 
31827  p5 S    0:00          \_ sshd: root@ttyp5        
31829  ?  S    0:00              \_ -bash 
31835  ?  R    0:00                  \_ ps fx 

Note that the first two processes are common to the two attempts.

Doh, this isn't about the PPID.  It's about the tty.

Also, using a 3.6.1 client, when logging out from this server, I get two messages:

$ logout
Connection to cdy.org closed by remote host.
Connection to cdy.org closed.

I get both of them when "exiting" using ^C as well.

I only get the second message "Connection to ... closed." when I use the same
client to connect to a different Linux system also running a 3.6.1 sshd but
built against libc6.
Comment 2 Darren Tucker 2003-04-09 14:01:47 AEST
This is probably related to bug #536.  Try the fix from there ("Try adding 
"#define STREAMS_PUSH_ACQUIRES_CTTY 1" to config.h and recompiling.") and if 
that's it please close this bug as a duplicate.

I didn't look at the MP-RAS thing but it sounds like the same problem.
Comment 3 Peter Stuge 2003-04-09 14:32:30 AEST
Sure is.
From syslog, for the -D case earlier:

 sshd[31829]: error: ioctl(TIOCSCTTY): Operation not permitted
 sshd[31829]: error: ioctl(TIOCSCTTY): Operation not permitte
 sshd[31829]: error: open /dev/tty failed - could not set controlling tty: No
such device or address
 sshd[31829]: error: open /dev/tty failed - could not set controlling tty: No
such device or address

Now the process tree looks like:
 2173  ?  S    0:00 sshd: root@ttyp5 
 2175  p5 S    0:00  \_ -bash 
 2247  p5 S    0:00      \_ openssh-3.6.1p1/sshd -D 
 2248  p5 S    0:00          \_ sshd: root@ttyp4        
 2250  p4 S    0:00              \_ -bash 
 2256  p4 R    0:00                  \_ ps fx 


*** This bug has been marked as a duplicate of 536 ***
Comment 4 Damien Miller 2004-04-14 12:24:19 AEST
Mass change of RESOLVED bugs to CLOSED