all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#1104: [emacs-w3m:10380] Re: pasting a password
       [not found] <b4mr66tnit1.fsf@jpl.org>
@ 2008-10-07  4:26 ` jidanni
  2008-11-16 21:15   ` bug#1104: marked as done ([emacs-w3m:10380] Re: pasting a password) Emacs bug Tracking System
  0 siblings, 1 reply; 15+ messages in thread
From: jidanni @ 2008-10-07  4:26 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: emacs-w3m

Dear bug-gnu-emacs:
The challenge: attempt to paste this password into the w3m password
entry field.

>>>>> "DW" == Debian Wiki <debian-www@lists.debian.org> writes:

DW> Somebody has requested to submit your account data to this email address.
DW> If you lost your password, please use the data below and just enter the
DW> password AS SHOWN into the wiki's password form field (use copy and paste
DW> for that).

DW> After successfully logging in, it is of course a good idea to set a new and known password.

DW> Login Name: myname

DW> Login Password: {SHA}reallylongsodontaskmetotypeitinbyhandplease

DW> Login URL: http://wiki.debian.org/UserPreferences

The problem is C-y is just read as a raw character there at the
mini buffer Password: prompt. emacs-w3m-version "1.4.263".

>>>>> "KY" == Katsumi Yamaoka <yamaoka@jpl.org> writes:

KY> That's what `read-passwd' that is an Emacs function does.  In
KY> the function definition, the special keys that it handles are
KY> only C-h, C-u and C-? (see the doc string).

OK, sending to bug-gnu-emacs. emacs-version "22.2.1".







^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: pasting a password
@ 2008-11-16  6:01 Chong Yidong
  2008-11-16  8:38 ` bug#1104: " Andreas Schwab
  2008-11-16  8:38 ` Andreas Schwab
  0 siblings, 2 replies; 15+ messages in thread
From: Chong Yidong @ 2008-11-16  6:01 UTC (permalink / raw)
  To: emacs-devel; +Cc: 1104, jidanni

> DW> Login Name: myname
>
> DW> Login Password: {SHA}reallylongsodontaskmetotypeitinbyhandplease
>
> DW> Login URL: http://wiki.debian.org/UserPreferences
>
> The problem is C-y is just read as a raw character there at the
> mini buffer Password: prompt. emacs-w3m-version "1.4.263".
>
> KY> That's what `read-passwd' that is an Emacs function does.  In
> KY> the function definition, the special keys that it handles are
> KY> only C-h, C-u and C-? (see the doc string).

The following patch allows yanking into the password prompt (I haven't
changed the docstring of read-passwd, which needs doing).  What do
people think about the advisability of this?

Note, in particular, that we can detect any key that performs yank or
yank-pop by using `key-binding'---but it works only if the command is a
single-character key sequence.  That's fine for C-y, but fails if the
user has customized `yank' to a two-character sequence.  I don't see any
way around this, though.

Another shortcoming is that the user can no longer enter a literal C-y;
but this may be a negligble problem---currently, the user can't enter
C-u either, since C-u clears the field.


*** trunk/lisp/subr.el.~1.620.~	2008-11-06 01:49:41.000000000 -0500
--- trunk/lisp/subr.el	2008-11-16 00:48:31.000000000 -0500
***************
*** 1818,1838 ****
  		      (setq c (read-char-exclusive nil t))
  		      (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
  	  (clear-this-command-keys)
! 	  (if (= c ?\C-u)
! 	      (progn
! 		(and (arrayp pass) (clear-string pass))
! 		(setq pass ""))
! 	    (if (and (/= c ?\b) (/= c ?\177))
! 		(let* ((new-char (char-to-string c))
! 		       (new-pass (concat pass new-char)))
! 		  (and (arrayp pass) (clear-string pass))
! 		  (clear-string new-char)
! 		  (setq c ?\0)
! 		  (setq pass new-pass))
! 	      (if (> (length pass) 0)
! 		  (let ((new-pass (substring pass 0 -1)))
! 		    (and (arrayp pass) (clear-string pass))
! 		    (setq pass new-pass))))))
  	(message nil)
  	(or pass default "")))))
  
--- 1818,1845 ----
  		      (setq c (read-char-exclusive nil t))
  		      (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
  	  (clear-this-command-keys)
! 	  (cond ((= c ?\C-u)
! 		 (and (arrayp pass) (clear-string pass))
! 		 (setq pass ""))
! 		((memq (key-binding (vector c))
! 		       '(yank yank-pop))
! 		 (let ((new-pass (concat pass
! 					 (substring-no-properties
! 					  (current-kill 0)))))
! 		   (and (arrayp pass) (clear-string pass))
! 		   (setq c ?\0)
! 		   (setq pass new-pass)))
! 		((and (/= c ?\b) (/= c ?\177))
! 		 (let* ((new-char (char-to-string c))
! 			(new-pass (concat pass new-char)))
! 		   (and (arrayp pass) (clear-string pass))
! 		   (clear-string new-char)
! 		   (setq c ?\0)
! 		   (setq pass new-pass)))
! 		((> (length pass) 0)
! 		 (let ((new-pass (substring pass 0 -1)))
! 		   (and (arrayp pass) (clear-string pass))
! 		   (setq pass new-pass)))))
  	(message nil)
  	(or pass default "")))))
  

Diff finished.  Sun Nov 16 00:51:53 2008




^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#1104: pasting a password
  2008-11-16  6:01 pasting a password Chong Yidong
@ 2008-11-16  8:38 ` Andreas Schwab
  2008-11-16  8:38 ` Andreas Schwab
  1 sibling, 0 replies; 15+ messages in thread
From: Andreas Schwab @ 2008-11-16  8:38 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 1104, jidanni, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> --- 1818,1845 ----
>   		      (setq c (read-char-exclusive nil t))
>   		      (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
>   	  (clear-this-command-keys)
> ! 	  (cond ((= c ?\C-u)
> ! 		 (and (arrayp pass) (clear-string pass))
> ! 		 (setq pass ""))
> ! 		((memq (key-binding (vector c))
> ! 		       '(yank yank-pop))

That does not work for yank-pop since the default binding is not a
single character one.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."






^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: pasting a password
  2008-11-16  6:01 pasting a password Chong Yidong
  2008-11-16  8:38 ` bug#1104: " Andreas Schwab
@ 2008-11-16  8:38 ` Andreas Schwab
  2008-11-16 16:08   ` Chong Yidong
                     ` (3 more replies)
  1 sibling, 4 replies; 15+ messages in thread
From: Andreas Schwab @ 2008-11-16  8:38 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 1104, jidanni, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> --- 1818,1845 ----
>   		      (setq c (read-char-exclusive nil t))
>   		      (and (/= c ?\r) (/= c ?\n) (/= c ?\e)))
>   	  (clear-this-command-keys)
> ! 	  (cond ((= c ?\C-u)
> ! 		 (and (arrayp pass) (clear-string pass))
> ! 		 (setq pass ""))
> ! 		((memq (key-binding (vector c))
> ! 		       '(yank yank-pop))

That does not work for yank-pop since the default binding is not a
single character one.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#1104: pasting a password
  2008-11-16  8:38 ` Andreas Schwab
  2008-11-16 16:08   ` Chong Yidong
@ 2008-11-16 16:08   ` Chong Yidong
  2008-11-16 19:21   ` Stefan Monnier
  2008-11-16 19:21   ` Stefan Monnier
  3 siblings, 0 replies; 15+ messages in thread
From: Chong Yidong @ 2008-11-16 16:08 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 1104, jidanni, emacs-devel

Andreas Schwab <schwab@suse.de> writes:

> That does not work for yank-pop since the default binding is not a
> single character one.

Yeah.  Maybe we should just hardwire C-y to yank into the password
prompt, and leave it at that.






^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: pasting a password
  2008-11-16  8:38 ` Andreas Schwab
@ 2008-11-16 16:08   ` Chong Yidong
  2008-11-16 16:08   ` bug#1104: " Chong Yidong
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: Chong Yidong @ 2008-11-16 16:08 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 1104, jidanni, emacs-devel

Andreas Schwab <schwab@suse.de> writes:

> That does not work for yank-pop since the default binding is not a
> single character one.

Yeah.  Maybe we should just hardwire C-y to yank into the password
prompt, and leave it at that.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#1104: pasting a password
  2008-11-16  8:38 ` Andreas Schwab
  2008-11-16 16:08   ` Chong Yidong
  2008-11-16 16:08   ` bug#1104: " Chong Yidong
@ 2008-11-16 19:21   ` Stefan Monnier
  2008-11-16 19:21   ` Stefan Monnier
  3 siblings, 0 replies; 15+ messages in thread
From: Stefan Monnier @ 2008-11-16 19:21 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 1104, Chong Yidong, emacs-devel, jidanni

> That does not work for yank-pop since the default binding is not a
> single character one.

It's bound to a single-event sequence, namely M-y.  Now, it's true that
in several circumstances, M-y will be turned into ESC y, so it will only
work in some cases and not all (typically it'll work in a GUI but not
in a tty).
I think to do it better, we'll need to use an implementation technique
closer to the one used by isearch.


        Stefan






^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: pasting a password
  2008-11-16  8:38 ` Andreas Schwab
                     ` (2 preceding siblings ...)
  2008-11-16 19:21   ` Stefan Monnier
@ 2008-11-16 19:21   ` Stefan Monnier
  2008-11-16 20:55     ` jidanni
                       ` (2 more replies)
  3 siblings, 3 replies; 15+ messages in thread
From: Stefan Monnier @ 2008-11-16 19:21 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 1104, Chong Yidong, emacs-devel, jidanni

> That does not work for yank-pop since the default binding is not a
> single character one.

It's bound to a single-event sequence, namely M-y.  Now, it's true that
in several circumstances, M-y will be turned into ESC y, so it will only
work in some cases and not all (typically it'll work in a GUI but not
in a tty).
I think to do it better, we'll need to use an implementation technique
closer to the one used by isearch.


        Stefan




^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#1104: pasting a password
  2008-11-16 19:21   ` Stefan Monnier
  2008-11-16 20:55     ` jidanni
@ 2008-11-16 20:55     ` jidanni
  2008-11-16 22:25     ` Juri Linkov
  2 siblings, 0 replies; 15+ messages in thread
From: jidanni @ 2008-11-16 20:55 UTC (permalink / raw)
  To: monnier; +Cc: 1104, schwab, cyd, emacs-devel

Regarding those mile long one-time passwords that we are supposed to
paste into our browsers, etc.:

Some people also wish to paste the password into the box with the
mouse too (middle button). Therefore please roll back all that extra
security, and just do the plain echo asterisks, like firefox or
whatever.

Speaking about M-y. I am a old dog who still types ESC instead of
Meta-key for the M- stuff -- never learned new tricks.






^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: pasting a password
  2008-11-16 19:21   ` Stefan Monnier
@ 2008-11-16 20:55     ` jidanni
  2008-11-16 21:07       ` Chong Yidong
  2008-11-16 20:55     ` bug#1104: " jidanni
  2008-11-16 22:25     ` Juri Linkov
  2 siblings, 1 reply; 15+ messages in thread
From: jidanni @ 2008-11-16 20:55 UTC (permalink / raw)
  To: monnier; +Cc: 1104, schwab, cyd, emacs-devel

Regarding those mile long one-time passwords that we are supposed to
paste into our browsers, etc.:

Some people also wish to paste the password into the box with the
mouse too (middle button). Therefore please roll back all that extra
security, and just do the plain echo asterisks, like firefox or
whatever.

Speaking about M-y. I am a old dog who still types ESC instead of
Meta-key for the M- stuff -- never learned new tricks.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: pasting a password
  2008-11-16 20:55     ` jidanni
@ 2008-11-16 21:07       ` Chong Yidong
  2008-11-16 23:10         ` Stefan Monnier
  0 siblings, 1 reply; 15+ messages in thread
From: Chong Yidong @ 2008-11-16 21:07 UTC (permalink / raw)
  To: jidanni; +Cc: schwab, 1104-done, monnier, emacs-devel

jidanni@jidanni.org writes:

> Regarding those mile long one-time passwords that we are supposed to
> paste into our browsers, etc.:
>
> Some people also wish to paste the password into the box with the
> mouse too (middle button). Therefore please roll back all that extra
> security, and just do the plain echo asterisks, like firefox or
> whatever.
>
> Speaking about M-y. I am a old dog who still types ESC instead of
> Meta-key for the M- stuff -- never learned new tricks.

I added a C-y binding to read-passwd.  More complicated stuff, such as
allowing mouse pastes, will have to wait for a isearch-like rewrite of
read-passwd, as Stefan said.

(Also, we should probably document the keybindings that can be used to
enter passwords into the Emacs manual.  I'll add a new node for it.)




^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#1104: marked as done ([emacs-w3m:10380] Re: pasting a password)
  2008-10-07  4:26 ` bug#1104: [emacs-w3m:10380] " jidanni
@ 2008-11-16 21:15   ` Emacs bug Tracking System
  0 siblings, 0 replies; 15+ messages in thread
From: Emacs bug Tracking System @ 2008-11-16 21:15 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]


Your message dated Sun, 16 Nov 2008 16:07:42 -0500
with message-id <877i737529.fsf@cyd.mit.edu>
and subject line Re: pasting a password
has caused the Emacs bug report #1104,
regarding [emacs-w3m:10380] Re: pasting a password
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
1104: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1104
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3057 bytes --]

From: jidanni@jidanni.org
To: bug-gnu-emacs@gnu.org
Cc: emacs-w3m@namazu.org
Subject: Re: [emacs-w3m:10380] Re: pasting a password
Date: Tue, 07 Oct 2008 12:26:47 +0800
Message-ID: <87r66t114o.fsf@jidanni.org>

Dear bug-gnu-emacs:
The challenge: attempt to paste this password into the w3m password
entry field.

>>>>> "DW" == Debian Wiki <debian-www@lists.debian.org> writes:

DW> Somebody has requested to submit your account data to this email address.
DW> If you lost your password, please use the data below and just enter the
DW> password AS SHOWN into the wiki's password form field (use copy and paste
DW> for that).

DW> After successfully logging in, it is of course a good idea to set a new and known password.

DW> Login Name: myname

DW> Login Password: {SHA}reallylongsodontaskmetotypeitinbyhandplease

DW> Login URL: http://wiki.debian.org/UserPreferences

The problem is C-y is just read as a raw character there at the
mini buffer Password: prompt. emacs-w3m-version "1.4.263".

>>>>> "KY" == Katsumi Yamaoka <yamaoka@jpl.org> writes:

KY> That's what `read-passwd' that is an Emacs function does.  In
KY> the function definition, the special keys that it handles are
KY> only C-h, C-u and C-? (see the doc string).

OK, sending to bug-gnu-emacs. emacs-version "22.2.1".




[-- Attachment #3: Type: message/rfc822, Size: 2039 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: jidanni@jidanni.org
Cc: monnier@iro.umontreal.ca, schwab@suse.de, 1104-done@emacsbugs.donarmstrong.com, emacs-devel@gnu.org
Subject: Re: pasting a password
Date: Sun, 16 Nov 2008 16:07:42 -0500
Message-ID: <877i737529.fsf@cyd.mit.edu>

jidanni@jidanni.org writes:

> Regarding those mile long one-time passwords that we are supposed to
> paste into our browsers, etc.:
>
> Some people also wish to paste the password into the box with the
> mouse too (middle button). Therefore please roll back all that extra
> security, and just do the plain echo asterisks, like firefox or
> whatever.
>
> Speaking about M-y. I am a old dog who still types ESC instead of
> Meta-key for the M- stuff -- never learned new tricks.

I added a C-y binding to read-passwd.  More complicated stuff, such as
allowing mouse pastes, will have to wait for a isearch-like rewrite of
read-passwd, as Stefan said.

(Also, we should probably document the keybindings that can be used to
enter passwords into the Emacs manual.  I'll add a new node for it.)


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: pasting a password
  2008-11-16 19:21   ` Stefan Monnier
  2008-11-16 20:55     ` jidanni
  2008-11-16 20:55     ` bug#1104: " jidanni
@ 2008-11-16 22:25     ` Juri Linkov
  2 siblings, 0 replies; 15+ messages in thread
From: Juri Linkov @ 2008-11-16 22:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: jidanni, emacs-devel

>> That does not work for yank-pop since the default binding is not a
>> single character one.
>
> It's bound to a single-event sequence, namely M-y.  Now, it's true that
> in several circumstances, M-y will be turned into ESC y, so it will only
> work in some cases and not all (typically it'll work in a GUI but not
> in a tty).
> I think to do it better, we'll need to use an implementation technique
> closer to the one used by isearch.

It seems this basically means just ripping out the meat of the function
isearch-other-meta-char.

-- 
Juri Linkov
http://www.jurta.org/emacs/




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: pasting a password
  2008-11-16 21:07       ` Chong Yidong
@ 2008-11-16 23:10         ` Stefan Monnier
  2008-11-16 23:37           ` Chong Yidong
  0 siblings, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2008-11-16 23:10 UTC (permalink / raw)
  To: Chong Yidong; +Cc: schwab, emacs-devel, 1104-done, jidanni

> I added a C-y binding to read-passwd.  More complicated stuff, such as
> allowing mouse pastes, will have to wait for a isearch-like rewrite of
> read-passwd, as Stefan said.

How 'bout using a completely different approach: setup a display-table
so that all chars get displayed as *, or else (so that the prompt can
be displayed properly) use an after-change-function to add a `display'
(or composition) property.
I.e. use normal editing, and only cause the display to use *.


        Stefan




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: pasting a password
  2008-11-16 23:10         ` Stefan Monnier
@ 2008-11-16 23:37           ` Chong Yidong
  0 siblings, 0 replies; 15+ messages in thread
From: Chong Yidong @ 2008-11-16 23:37 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: schwab, emacs-devel, 1104-done, jidanni

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> How 'bout using a completely different approach: setup a display-table
> so that all chars get displayed as *, or else (so that the prompt can
> be displayed properly) use an after-change-function to add a `display'
> (or composition) property.  I.e. use normal editing, and only cause
> the display to use *.

That would allow you to copy the contents of the password prompt.  My
understanding is that most applications don't allow that (if you
accidentally leave the terminal without pressing enter, someone would be
able to copy what you've typed, paste it somewhere else, and view it in
cleartext).




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-11-16 23:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-16  6:01 pasting a password Chong Yidong
2008-11-16  8:38 ` bug#1104: " Andreas Schwab
2008-11-16  8:38 ` Andreas Schwab
2008-11-16 16:08   ` Chong Yidong
2008-11-16 16:08   ` bug#1104: " Chong Yidong
2008-11-16 19:21   ` Stefan Monnier
2008-11-16 19:21   ` Stefan Monnier
2008-11-16 20:55     ` jidanni
2008-11-16 21:07       ` Chong Yidong
2008-11-16 23:10         ` Stefan Monnier
2008-11-16 23:37           ` Chong Yidong
2008-11-16 20:55     ` bug#1104: " jidanni
2008-11-16 22:25     ` Juri Linkov
     [not found] <b4mr66tnit1.fsf@jpl.org>
2008-10-07  4:26 ` bug#1104: [emacs-w3m:10380] " jidanni
2008-11-16 21:15   ` bug#1104: marked as done ([emacs-w3m:10380] Re: pasting a password) Emacs bug Tracking System

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.