Why does this work?

Jonathan I. Kamens jik at athena.mit.edu
Tue Feb 5 08:27:32 AEST 1991


In article <9102042103.AA16650 at cmsun.nrl.navy.mil>, phillips at CMSUN.NRL.NAVY.MIL (Lee Phillips) writes:
|> FTP then prompts me for my password before reading the commands from
|> f (my username is in the .netrc file, but not my password).  This is 
|> just what I want, but why does it work?  How does FTP know not to
|> look in f for my password?  

  Ftp, like most programs that prompt for password, opens /dev/tty, flushes
input from it, and then reads the password from it, rather than reading the
password from stdin.

  In fact, it probably uses the getpass(3) library function.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.shell mailing list