GNU bug report logs -
#12117
read-passwd deletes prompt
Previous Next
Reported by: Juri Linkov <juri <at> jurta.org>
Date: Thu, 2 Aug 2012 08:25:01 UTC
Severity: minor
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12117 in the body.
You can then email your comments to 12117 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12117
; Package
emacs
.
(Thu, 02 Aug 2012 08:25:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> jurta.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 02 Aug 2012 08:25:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12117
; Package
emacs
.
(Mon, 06 Aug 2012 22:09:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 12117 <at> debbugs.gnu.org (full text, mbox):
> 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))
Hmm... I guess the problem is even more general: any minibuffer input
during insert-file-contents will suffer from it (granted, there usually
isn't much minibuffer input during such calls, luckily).
Maybe read-from-minibuffer should let-bind inhibit-read-only to nil?
That sounds ugly, tho.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12117
; Package
emacs
.
(Tue, 07 Aug 2012 00:14:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 12117 <at> debbugs.gnu.org (full text, mbox):
> Hmm... I guess the problem is even more general: any minibuffer input
> during insert-file-contents will suffer from it (granted, there usually
> isn't much minibuffer input during such calls, luckily).
>
> Maybe read-from-minibuffer should let-bind inhibit-read-only to nil?
> That sounds ugly, tho.
Since there is not much minibuffer input during insert-file-contents
(one is known at the moment) then perhaps it would be safer to fix
just these places specific to insert-file-contents:
=== modified file 'lisp/epa.el'
--- lisp/epa.el 2012-06-08 16:39:49 +0000
+++ lisp/epa.el 2012-08-07 00:01:14 +0000
@@ -589,6 +589,10 @@ (defun epa-display-verify-result (verify
(make-obsolete 'epa-display-verify-result 'epa-display-info "23.1")
(defun epa-passphrase-callback-function (context key-id handback)
+ ;; Bind `inhibit-read-only' to nil because `find-file-noselect-1' binds
+ ;; it to t (for `insert-file-contents') that allows the user to delete
+ ;; characters in the read-only minibuffer prompt in `read-passwd'.
+ (let ((inhibit-read-only nil))
(if (eq key-id 'SYM)
(read-passwd
(format "Passphrase for symmetric encryption%s: "
@@ -603,7 +607,7 @@ (defun epa-passphrase-callback-function
(let ((entry (assoc key-id epg-user-id-alist)))
(if entry
(format "Passphrase for %s %s: " key-id (cdr entry))
- (format "Passphrase for %s: " key-id)))))))
+ (format "Passphrase for %s: " key-id))))))))
(defun epa-progress-callback-function (_context what _char current total
handback)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#12117
; Package
emacs
.
(Tue, 07 Aug 2012 15:17:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 12117 <at> debbugs.gnu.org (full text, mbox):
>> Hmm... I guess the problem is even more general: any minibuffer input
>> during insert-file-contents will suffer from it (granted, there usually
>> isn't much minibuffer input during such calls, luckily).
>> Maybe read-from-minibuffer should let-bind inhibit-read-only to nil?
>> That sounds ugly, tho.
> Since there is not much minibuffer input during insert-file-contents
> (one is known at the moment) then perhaps it would be safer to fix
> just these places specific to insert-file-contents:
No, I'd rather fix it in read-from-minibuffer than in just those
specific cases we bump into.
I think the "right" fix might be to make inhibit-read-only
buffer-local. But I fear some code relies on it being global, so it
might introduce bugs.
Stefan
Reply sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
You have taken responsibility.
(Wed, 15 Aug 2012 04:13:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Juri Linkov <juri <at> jurta.org>
:
bug acknowledged by developer.
(Wed, 15 Aug 2012 04:13:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 12117-done <at> debbugs.gnu.org (full text, mbox):
> 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
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 12 Sep 2012 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 284 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.