zsh-workers
 help / color / mirror / code / Atom feed
* How to read password (no echo) from builtin?
@ 2017-05-31 16:39 Sebastian Gniazdowski
  2017-06-01 20:31 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2017-05-31 16:39 UTC (permalink / raw)
  To: zsh-workers

Hello,
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.

Is there other way?

-- 
Sebastian Gniazdowski
psprint /at/ zdharma.org


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to read password (no echo) from builtin?
  2017-05-31 16:39 How to read password (no echo) from builtin? Sebastian Gniazdowski
@ 2017-06-01 20:31 ` Bart Schaefer
  2017-06-02  1:46   ` Sebastian Gniazdowski
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2017-06-01 20:31 UTC (permalink / raw)
  To: Sebastian Gniazdowski, zsh-workers

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.

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to read password (no echo) from builtin?
  2017-06-01 20:31 ` Bart Schaefer
@ 2017-06-02  1:46   ` Sebastian Gniazdowski
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Gniazdowski @ 2017-06-02  1:46 UTC (permalink / raw)
  To: Bart Schaefer, zsh-workers



On 1 czerwca 2017 at 22:31:56, Bart Schaefer (schaefer@brasslantern.com) 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-02  1:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 16:39 How to read password (no echo) from builtin? Sebastian Gniazdowski
2017-06-01 20:31 ` Bart Schaefer
2017-06-02  1:46   ` Sebastian Gniazdowski

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).