[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Reading passwords in a console application
- From: Tony Finch <dot@...>
- Date: Thu, 11 Aug 2011 12:28:58 +0100
Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
>
> io.write("password: ")
> io.flush()
> os.execute("stty -echo")
> password=io.read()
> os.execute("stty sane")
> if (hash(password)==hashed_password) then ...
Best to use "stty echo" rather than "stty sane" to avoid trampling other
tty settings.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
Irish Sea: Southwesterly 4 or 5, but variable 3 at times in north. Slight or
moderate. Occasional rain, fog patches. Good, occasionally poor, occasionally
very poor.