Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to read password (no echo) from builtin?

On 1 czerwca 2017 at 22:31:56, Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) wrote:
> On May 31, 6:39pm, Sebastian Gniazdowski wrote:
> }
> } I need to read a password (no echo to terminal) from builtin, provided
> } by module. Should I invoke bin_read? I would have to find a way to
> } provide Options typedef argument. How to do it? Could also invoke
> } vared, but I don't see builtin for it.
> bin_vared is in Src/Zle/zle_main.c. However I don't expect that when
> reading a password you want to attempt to interpret ZLE widget actions.

Ah right, I blindly followed consensus "vared is better" forgetting that it is better because it can complete e.g. paths, which doesn't matter for passwords.

> Construct a "builtin read -rs" command and call execstring(), perhaps?

Cool idea, thanks. I now ended up with -a option to provide password, and -A to provide file with password. Redis passwords are in general long because the database is
fast enough to reply to intensive brute force attack, so authors say to have a long password.

Sebastian Gniazdowski
psprint /at/ zdharma.org

Messages sorted by: Reverse Date, Date, Thread, Author