Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!brl-adm!seismo!rochester!ritcv!rocksvax!rocksanne!sunybcs!westpt!bill From: bill@westpt.UUCP Newsgroups: comp.unix.questions Subject: Re: login gripes Message-ID: <553@westpt.usma.edu> Date: Tue, 31-Mar-87 11:15:01 EST Article-I.D.: westpt.553 Posted: Tue Mar 31 11:15:01 1987 Date-Received: Sat, 4-Apr-87 09:34:02 EST References: <8703231450.AA18626@ephemeral.ai.toronto.edu> <15831@sun.uucp> Organization: US Military Academy, West Point, NY Lines: 26 Summary: stdin <> /dev/tty In article <15831@sun.uucp>, guy%gorodish@Sun.COM (Guy Harris) writes: > > Can't it turn echoing off right away so that when I am in a hurry the > > first few characters of my password don't end up on the screen? > > > > Why do these characters get ignored? > > Because "getty" normally runs in RAW mode, while the password is > collected in cooked mode. When you switch to or from RAW mode, > unread input is discarded. > Actually what is happening is the password is taken in using a call to the routine getpass() which reads directly from /dev/tty and not from the stdin. So anything you typed before getting the Password: prompt went to the stdin and is not available to that call. I can only assume this was done to prevent anyone from spoofing login as to who is really there. The echo goes away because reading from /dev/tty has nothing to do with the current settings of stty. Another catch to this method is reads and writes to/from /dev/tty cannot be redirected. UUCP: {philabs,phri}!westpt!bill PHONE: (914)446-7747 US SNAIL: Martin Marietta Data Systems RADIO: KB3YV USMA, Bldg 600, Room 26 AX.25 KB3YV @ WA2RKN West Point, NY 10996