Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!munnari.oz.au!bruce!monu0.cc.monash.edu.au!monu6!rda614j From: rda614j@monu6.cc.monash.edu.au (Tooraj Enayati) Newsgroups: comp.lang.c Subject: Re: Reading a keystroke w/o echo Summary: Reading password Message-ID: <1991May28.051144.14703@monu6.cc.monash.edu.au> Date: 28 May 91 05:11:44 GMT References: <990007@hpcc01.HP.COM> <1991May23.184302.13918@lut.fi> <24450@lanl.gov> Sender: rda614j@monu6.cc.monash.edu.au (tooraj Enayati) Organization: Monash University, Caulfield Campus Lines: 43 In article <24450@lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes: >In article <1991May23.184302.13918@lut.fi>, junki@lut.fi (Juha Nurmela) writes: >|> [...] >|> puts("Please dim Your monitor with knob called brightness."); >|> puts("Then key Your passwd terminating with ENTER and readjust the knob"); >|> gets(password); >|> puts("\n\n\n\n ...50 times ... \n"); > >Sun workstations don't have a brightness control knob. > >J. Giles Why not use getpass()? It's much easier. Here is man entery for getpass. It's should be available under most Unix systems. ----------------------------------------------------------------- man getpass GETPASS(3-ucb) September 27, 1988 GETPASS(3-ucb) NAME getpass - read a password SYNOPSIS char *getpass(prompt) char *prompt; DESCRIPTION Getpass reads a password from the file /dev/tty, or, if that cannot be opened, from the standard input, after prompting with the null-terminated string prompt and disabling echoing. A pointer is returned to a null-terminated string of at most 8 characters. [some stuff deleted] -------------------------------------------------------------------- Tooraj -- Tooraj Enayati e-mail address: rda614j@monu6.cc.monash.edu.au | One planet Third year of B. Computing (Digital Technology) | one people Monash University, Caulfield Campus, Melbourne, AUSTRALIA | why...