[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] Avoid recording chars when reading passwords

From: Manuel Giraud
Subject: Re: [Patch] Avoid recording chars when reading passwords
Date: Mon, 13 Jun 2022 15:26:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Manuel Giraud <manuel@ledu-giraud.fr>
>> Date: Wed, 08 Jun 2022 15:46:19 +0200
>> With this patch, passwords won't appear in the lossage or the dribble
>> file.
> We already have a facility for this, see 'no-record' in the
> description of unread-command-events in the ELisp manual.  Please see
> if you can use that instead.

Ok but I don't quite understand how unread-command-events works. For
instance, if I put this code into `read-passwd':

--8<---------------cut here---------------start------------->8---
(setq-local unread-command-events
            (mapcar #'(lambda (x) (cons 'no-record x))
                    (listify-key-sequence "mypassword")))
--8<---------------cut here---------------end--------------->8---

It will prefilled (and not recorded) at prompt with "mypassord" but I'd
like to be able to type the real password that I don't know in
advance. In `read-passwd', the password is read with `read-string' that
is C codeā€¦ Anyway, can someone explain what is the purpose (and usage)
of unread-command-events?

> And if you must have a variable, I'd prefer to un-obsolete
> inhibit--record-char, which was once used for this purpose, but no
> longer is, and restore the code in keyboard.c which supported it.

I was not aware of this code. But yes, maybe we should do that.

Manuel Giraud

reply via email to

[Prev in Thread] Current Thread [Next in Thread]