From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.devel Subject: Re: [Patch] Avoid recording chars when reading passwords Date: Mon, 13 Jun 2022 15:26:41 +0200 Message-ID: <87o7ywae3y.fsf@elite.giraud> References: <87edzz8dzo.fsf@elite.giraud> <834k0v5f7z.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19325"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix) Cc: Manuel Giraud , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 13 15:38:34 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0kH3-0004q5-9I for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Jun 2022 15:38:33 +0200 Original-Received: from localhost ([::1]:33306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0kH2-0002jA-1b for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Jun 2022 09:38:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0k5n-00018k-DV for emacs-devel@gnu.org; Mon, 13 Jun 2022 09:26:57 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:7997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0k5e-0004hV-AE; Mon, 13 Jun 2022 09:26:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=/2aNVBox5TsRFX2u j+wL80WTT1FK3zQp0EChBP/q7Eo=; h=in-reply-to:date:references:subject: cc:to:from; d=ledu-giraud.fr; b=AZmJpqczuT2dqKVLWsouK4NPQANi2ugFmvRiyt G0889mnM1pOyUpxSWodT1EqJ6L4onOm1EtEWG5c+/xz6iefJ/E/O5U4rbe0pAI1Ekbzh9z 5xOCOzecAsEvf/Cc2LvtQV9ETH78i8VOZ+eIr7qe7563tmO63HNaOuI3M58Brw/W4L90io TaUaFEB83QceqHhk6mX1mPgq3vCrpZubl2fijl0/WB/AKGe9tzmoZIVgDj/b2p3OZqsJGf EvYcuJsdmAL7BP2P4pvywVtdIu3V4i/27ZrOR1HSl63Sz+cK9KxN/AYECqMyaNSICSzJ0b tfl8+0+I4b+lnYfuZGuAYVNg== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id ca6b8ebe (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 13 Jun 2022 15:26:42 +0200 (CEST) In-Reply-To: <834k0v5f7z.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 Jun 2022 18:48:00 +0300") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:291142 Archived-At: Eli Zaretskii writes: >> From: Manuel Giraud >> Date: Wed, 08 Jun 2022 15:46:19 +0200 >>=20 >> 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=E2=80=A6 Anyway, can someone explain what is the purpose (and usa= ge) 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. Thanks. --=20 Manuel Giraud