Subject: bug#12117: closed (Re: bug#12117: read-passwd deletes prompt)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 15 Aug 2012 04:13:02 +0000

Your bug report

#12117: read-passwd deletes prompt

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
12117: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12117
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#12117: read-passwd deletes prompt
From: Stefan Monnier <[email-masked]>
To: Juri Linkov <[email-masked]>
Cc: [email-masked]
Date: Wed, 15 Aug 2012 00:03:24 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> One solution is to let-bind `inhibit-read-only' to nil either
> in `read-passwd' or in `epa-passphrase-callback-function',
> or maybe in both?

I've installed a patch which let-binds inhibit-read-only in
read-from-minibuffer.

        Stefan

Subject: read-passwd deletes prompt
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Thu, 02 Aug 2012 11:07:06 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

A new implementation of `read-passwd' allows the user to delete
characters from the minibuffer's prompt, i.e. when the user
mistypes the password and wants to retype it after clearing with
a few of DELs, typing more DEL will start removing characters
from the prompt.

This can be reproduced by visiting a GPG encrypted file that uses
`epa-passphrase-callback-function' that calls `read-passwd'.

The problem is that `find-file-noselect-1' binds `inhibit-read-only' to t
before calling `insert-file-contents':

            (let ((inhibit-read-only t))
              (insert-file-contents filename t))

The simplest test case to demonstrate the problem is to type DEL
after evaluating:

  (let ((inhibit-read-only t))
    (read-passwd "Password: "))

What is expected is: instead of deleting characters from the prompt
DEL should display the message "Text is read-only".

One solution is to let-bind `inhibit-read-only' to nil either
in `read-passwd' or in `epa-passphrase-callback-function',
or maybe in both?