Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!mintaka!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.shell Subject: Re: Why does this work? Message-ID: <1991Feb4.212732.19142@athena.mit.edu> Date: 4 Feb 91 21:27:32 GMT References: <9102042103.AA16650@cmsun.nrl.navy.mil> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 17 In article <9102042103.AA16650@cmsun.nrl.navy.mil>, phillips@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@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710