Discussion:
[rancid] hpuifilter - TTY support (for SSH)
David Luyer
2008-09-05 17:31:34 UTC
Permalink
G'day,

As has been mentioned on this list in the (distant?) past, hpuifilter
often does not work properly with SSH, as SSH will attempt to read the
password from /dev/tty which will sometimes successfully get the password
from the expect script, but sometimes the hpuifilter process will drain
this password out of the TTY before the SSH process gets it, and write
it to the SSH process STDIN, resulting in the SSH process hanging (waiting
for the password on it's /dev/tty file descriptor). For more hilarity,
often the SSH process gets the first character or two via /dev/tty, and
the hpuifilter process gets the rest and passes it in via STDIN.

Fortunately, this is relatively easily solved. The attached patch adds
a "-t" option to hpuifilter, which makes it use its own TTY.

This means you end up burning two TTYs when talking to a HP via SSH (one
for expect, one for hpuifilter), so you want to make sure you only use
this option for HPs you're using SSH with, and not HPs you're using telnet
with.

Anyway: please find patch attached.

Thanks,
David.
--
David Luyer
Google, Inc
Loading...