[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#407866: ssh tries to access /dev/tty even with -T, and when no tty available



Package: ssh
Version: 1:4.3p2-8
Severity: normal

Using this commandline within a script with /dev/stdin redirected to
/dev/null, and trying to make sure that it never asks for passwords in
the case that the remove server has lost its NFS mounts and can't find
my key (I just want it to bail in that case):
ssh -T -D 1081 -C tconnors@remotehost waitforme

It tries to read from /dev/tty, locking up the entire window manager
as everything gets a SIGTTOU.

> l /proc/`pidof ssh`/fd
total 6
lr-x------ 1 tconnors tconnors 64 Jan 22 09:46 0 -> /dev/null
l-wx------ 1 tconnors tconnors 64 Jan 22 09:46 1 -> /tmp/sshDswin.out
l-wx------ 1 tconnors tconnors 64 Jan 22 09:46 2 -> /tmp/sshDswin.out
lrwx------ 1 tconnors tconnors 64 Jan 22 09:46 3 -> socket:[10789368]
lrwx------ 1 tconnors tconnors 64 Jan 22 09:46 4 -> socket:[10789381]
lrwx------ 1 tconnors tconnors 64 Jan 22 09:46 5 -> /dev/tty

ssh takes 99% CPU, and everything else gets suspended.  strace of the
ssh process reveals an endless loop of trying to read from the tty
(which I can't imagine even existing -- unless its trying to talk to
the tty that startx ran off), getting SIGTTOU, and trying again:

Process 31073 attached - interrupt to quit
--- SIGTTOU (Stopped (tty output)) @ 0 (0) ---
sigreturn()                             = ? (mask now [])
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(5, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = ? ERESTARTSYS (To be restarted)
--- SIGTTOU (Stopped (tty output)) @ 0 (0) ---
sigreturn()                             = ? (mask now [])
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(5, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = ? ERESTARTSYS (To be restarted)
--- SIGTTOU (Stopped (tty output)) @ 0 (0) ---
sigreturn()                             = ? (mask now [])
ioctl(5, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
<ad infinitum>


-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12.3
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)

Versions of packages ssh depends on:
ii  openssh-client                1:4.3p2-8  Secure shell client, an rlogin/rsh
ii  openssh-server                1:4.3p2-8  Secure shell server, an rshd repla

ssh recommends no packages.

-- debconf information:
  ssh/insecure_rshd:
  ssh/privsep_ask: true
* ssh/user_environment_tell:
* ssh/forward_warning:
  ssh/insecure_telnetd:
  ssh/new_config: true
* ssh/use_old_init_script: true
* ssh/SUID_client: true
  ssh/disable_cr_auth: false
* ssh/privsep_tell:
  ssh/ssh2_keys_merged:
* ssh/protocol2_only: true
  ssh/encrypted_host_key_but_no_keygen:
* ssh/run_sshd: true




Reply to: