* Minor comint.el bug
@ 2003-09-22 9:35 Marshall, Simon
2003-09-22 14:05 ` Davis Herring
[not found] ` <E1A1wLO-0007um-Hh@fencepost.gnu.org>
0 siblings, 2 replies; 4+ messages in thread
From: Marshall, Simon @ 2003-09-22 9:35 UTC (permalink / raw)
Cc: 'Davis Herring'
Guys, I don't maintain comint.el anymore so this report would be best
dealt with by whoever does now. Davis, what version of Emacs is this?
-----Original Message-----
From: Davis Herring [mailto:sdh6@ra.msstate.edu]
Sent: 22 September 2003 10:18
To: Olin Shivers; Simon Marshall
Subject: Minor comint.el bug
If, when using `comint-watch-for-password-prompt' as an output filter,
the
user quits at the pretty password prompt it provides, the `nil' that
`comint-read-noecho' returns causes `send-invisible' to prompt again
with
the generic "Non-echoed text: ", which is confusing. However, if the
user
quits again, this time it displays "Warning: text will be echoed"; this
is a good thing, so it would be bad to just make
`comint-watch-for-password-prompt' do (and pw (send-invisible pw)).
Some
merger or refactoring is evidently needed (which I'd be glad to attempt
if
desired).
Happy debugging,
Davis Herring
--
Ship Quantum Express -- the honest company that admits to having no idea
when your shipment will get there or where it will be when it does!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Minor comint.el bug
2003-09-22 9:35 Minor comint.el bug Marshall, Simon
@ 2003-09-22 14:05 ` Davis Herring
[not found] ` <E1A1wLO-0007um-Hh@fencepost.gnu.org>
1 sibling, 0 replies; 4+ messages in thread
From: Davis Herring @ 2003-09-22 14:05 UTC (permalink / raw)
Cc: 'Emacs Bug'
> Guys, I don't maintain comint.el anymore so this report would be best
> dealt with by whoever does now. Davis, what version of Emacs is this?
Oops! Aheh. Here we go:
`comint-watch-for-password-prompt' doesn't try to come up with a pretty
prompt in
GNU Emacs 20.7.1 (sparc-sun-solaris2.8, X toolkit) of Mon Feb 19 2001 on steel
, and so the bug does not manifest there. However, both
GNU Emacs 21.1.1 (i386-msvc-windows98.2222) of 2001-10-22 on buffy
and
GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2003-04-29 on quattro
generate that prompt and so do experience the bug.
Of course, we now have another (trivial) bug: comint.el's maintainer
list...
Davis Herring
> -----Original Message-----
> From: Davis Herring [mailto:sdh6@ra.msstate.edu]
> Sent: 22 September 2003 10:18
> To: Olin Shivers; Simon Marshall
> Subject: Minor comint.el bug
>
> If, when using `comint-watch-for-password-prompt' as an output filter,
> the user quits at the pretty password prompt it provides, the `nil' that
> `comint-read-noecho' returns causes `send-invisible' to prompt again
> with the generic "Non-echoed text: ", which is confusing. However, if
> the user quits again, this time it displays "Warning: text will be
> echoed"; this is a good thing, so it would be bad to just make
> `comint-watch-for-password-prompt' do (and pw (send-invisible pw)). Some
> merger or refactoring is evidently needed (which I'd be glad to attempt
> if desired).
>
> Happy debugging,
> Davis Herring
--
Ship Quantum Express -- the honest company that admits to having no idea
when your shipment will get there or where it will be when it does!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Minor comint.el bug
[not found] <mailman.512.1064223370.21628.bug-gnu-emacs@gnu.org>
@ 2003-09-22 15:56 ` Kevin Rodgers
0 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2003-09-22 15:56 UTC (permalink / raw)
Marshall, Simon wrote:
> -----Original Message-----
> From: Davis Herring [mailto:sdh6@ra.msstate.edu]
> Sent: 22 September 2003 10:18
> To: Olin Shivers; Simon Marshall
> Subject: Minor comint.el bug
>
>
> If, when using `comint-watch-for-password-prompt' as an output filter,
> the
> user quits at the pretty password prompt it provides, the `nil' that
> `comint-read-noecho' returns causes `send-invisible' to prompt again
> with
> the generic "Non-echoed text: ", which is confusing. However, if the
> user
> quits again, this time it displays "Warning: text will be echoed"; this
> is a good thing, so it would be bad to just make
> `comint-watch-for-password-prompt' do (and pw (send-invisible pw)).
> Some
> merger or refactoring is evidently needed (which I'd be glad to attempt
> if
> desired).
Why not just (send-invisible (or pw ""))?
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Minor comint.el patch
[not found] ` <E1A1wLO-0007um-Hh@fencepost.gnu.org>
@ 2003-09-25 12:40 ` Davis Herring
0 siblings, 0 replies; 4+ messages in thread
From: Davis Herring @ 2003-09-25 12:40 UTC (permalink / raw)
Cc: Richard Stallman
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1189 bytes --]
Quoting Richard Stallman's mail of Tue, 23 Sep 2003 19:13:18 -0400:
> David's suggestion seems right to me.
> I will get it installed. Thanks.
I'm assuming that you're referring either to my comment about
(and pw (send-invisible pw)), or else to Kevin Rodgers' suggestion of
(send-invisible (or pw "")) ...
Unfortunately, neither one of these is particularly useful; neither one of
them prints any sort of message (not even 'Quit') to indicate that the
password is no longer being read invisibly, and the latter actually sends
something (even if it's just a newline) when the user tries to abort the
command -- Bad Thing.
I believe what we want is a slight reorganization of those functions;
unless they get heavy Lisp usage, it shouldn't cause much
incompatibility damage. The attached patch (versus 21.3.1) causes there
to be no further prompt but rather the proper warning when the user quits.
I also added references to 'clear-this-command-keys' in the docstrings;
would it make sense to make that function interactive?
Davis Herring
--
Ship Quantum Express -- the honest company that admits to having no idea
when your shipment will get there or where it will be when it does!
[-- Attachment #2: New vs. 21.3.1 --]
[-- Type: TEXT/PLAIN, Size: 3324 bytes --]
*** comint-21.3.el Thu Sep 25 07:13:32 2003
--- comint.el Thu Sep 25 07:33:26 2003
***************
*** 1874,1880 ****
filter and C-g is pressed, this function returns nil rather than a string).
Note that the keystrokes comprising the text can still be recovered
! \(temporarily) with \\[view-lossage]. Some people find this worrysome.
Once the caller uses the password, it can erase the password
by doing (fillarray STRING 0)."
(let ((ans "")
--- 1874,1881 ----
filter and C-g is pressed, this function returns nil rather than a string).
Note that the keystrokes comprising the text can still be recovered
! \(temporarily) with \\[view-lossage]. Some people find this worrysome (see,
! however, `clear-this-command-keys').
Once the caller uses the password, it can erase the password
by doing (fillarray STRING 0)."
(let ((ans "")
***************
*** 1921,1944 ****
(message "")
ans)))
! (defun send-invisible (str)
"Read a string without echoing.
Then send it to the process running in the current buffer.
The string is sent using `comint-input-sender'.
Security bug: your string can still be temporarily recovered with
! \\[view-lossage]."
(interactive "P") ; Defeat snooping via C-x ESC ESC
(let ((proc (get-buffer-process (current-buffer))))
! (cond ((not proc)
! (error "Current buffer has no process"))
! ((stringp str)
! (comint-snapshot-last-prompt)
! (funcall comint-input-sender proc str))
! (t
! (let ((str (comint-read-noecho "Non-echoed text: " t)))
! (if (stringp str)
! (send-invisible str)
! (message "Warning: text will be echoed")))))))
(defun comint-watch-for-password-prompt (string)
"Prompt in the minibuffer for password and send without echoing.
--- 1922,1943 ----
(message "")
ans)))
! (defun send-invisible (&optional prompt)
"Read a string without echoing.
Then send it to the process running in the current buffer.
The string is sent using `comint-input-sender'.
Security bug: your string can still be temporarily recovered with
! \\[view-lossage]; `clear-this-command-keys' can fix that."
(interactive "P") ; Defeat snooping via C-x ESC ESC
(let ((proc (get-buffer-process (current-buffer))))
! (if proc
! (let ((str (comint-read-noecho (or prompt "Non-echoed text: ") t)))
! (if (stringp str)
! (progn
! (comint-snapshot-last-prompt)
! (funcall comint-input-sender proc str))
! (message "Warning: text will be echoed")))
! (error "Current buffer has no process"))))
(defun comint-watch-for-password-prompt (string)
"Prompt in the minibuffer for password and send without echoing.
***************
*** 1948,1955 ****
This function could be in the list `comint-output-filter-functions'."
(when (string-match comint-password-prompt-regexp string)
! (let ((pw (comint-read-noecho string t)))
! (send-invisible pw))))
\f
;; Low-level process communication
--- 1947,1953 ----
This function could be in the list `comint-output-filter-functions'."
(when (string-match comint-password-prompt-regexp string)
! (send-invisible string)))
\f
;; Low-level process communication
[-- Attachment #3: Type: text/plain, Size: 148 bytes --]
_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-09-25 12:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-22 9:35 Minor comint.el bug Marshall, Simon
2003-09-22 14:05 ` Davis Herring
[not found] ` <E1A1wLO-0007um-Hh@fencepost.gnu.org>
2003-09-25 12:40 ` Minor comint.el patch Davis Herring
[not found] <mailman.512.1064223370.21628.bug-gnu-emacs@gnu.org>
2003-09-22 15:56 ` Minor comint.el bug Kevin Rodgers
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.