From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 981 invoked by alias); 2 Jun 2017 01:46:14 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41199 Received: (qmail 27680 invoked from network); 2 Jun 2017 01:46:14 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(0.0/5.0):. Processed in 1.661642 secs); 02 Jun 2017 01:46:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at zdharma.org does not designate permitted sender hosts) X-Virus-Scanned: by amavisd-new using ClamAV (17) Date: Fri, 2 Jun 2017 03:46:10 +0200 From: Sebastian Gniazdowski To: Bart Schaefer , zsh-workers@zsh.org Message-ID: In-Reply-To: <170601133132.ZM1566@torch.brasslantern.com> References: <170601133132.ZM1566@torch.brasslantern.com> Subject: Re: How to read password (no echo) from builtin? X-Mailer: Airmail (231) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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