What's a good Java mailing list?

Kevin D. Clark clark_k at pannaway.com
Wed Aug 17 16:35:28 EDT 2005


Adam Russell writes:

> Apparently the difference is that some programs like ssh(maybe yours
> too?) do not read from stdin but, rather, "the terminal". Now, my
> system programming experience is limited so I am not quite sure what
> "reading from the terminal means". Does that mean that it uses
> something like ncurses to read input? If so, how is that different
> than just reading stdin besides just wrapping it in someway? If
> soneoen could care to explain it to me that would be cool. Always
> sort of wondered.......

This is a FAQ in some places.

The thing that you are alluding to here is that some programs happily
read from stdin wheras others (most famously the passwd program) go to
the trouble of reading from the controlling terminal (/dev/tty).  It's
not really a ncurses thing.

All of this is done for "security reasons", but I have to confess I
don't understand these anymore since (1) Expect is nearly ubiquitous
nowadays (2) it isn't impossible to write pty code (nefarious or not)
(3) many modern versions of tools like passwd give you the option of
reading from stdin anyways and (4) if you're stupid enough to use such
a feature and leave whatever scripts/etc. that drive this program in
cleartext, then you'll eventually get what you richly deserve.

The OP didn't mention that his program was reading directly from
/dev/tty, so I doubt that this is relevant to the problem.  I'm not
sure what the problem is at this point either.

Regards,

--kevin  (changing into his light asbestos underwear right now)
-- 
GnuPG ID: B280F24E                     And the madness of the crowd
alumni.unh.edu!kdc                     Is an epileptic fit
                                       -- Tom Waits



More information about the Discuss mailing list