GNU bug report logs - #2817
[PATCH] Emacs CVS: comint-password-prompt-regexp - support ssh-keygen

Previous Next

Package: emacs;

Reported by: Jari Aalto <jari.aalto <at> cante.net>

Date: Sun, 29 Mar 2009 16:30:03 UTC

Severity: wishlist

Tags: patch

Done: Chong Yidong <cyd <at> stupidchicken.com>

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 2817 in the body.
You can then email your comments to 2817 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2817; Package emacs. (Sun, 29 Mar 2009 16:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jari Aalto <jari.aalto <at> cante.net>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 29 Mar 2009 16:30:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jari Aalto <jari.aalto <at> cante.net>
To: Emacs bug BTS <submit <at> debbugs.gnu.org>
Subject: [PATCH] Emacs CVS: comint-password-prompt-regexp - support ssh-keygen
Date: Sun, 29 Mar 2009 19:20:31 +0300
[Message part 1 (text/plain, inline)]
Added support for ssh-keygen(1) prompt and changed to new format because
the old one was hard to decipher and keep track on.

The enw one is easier to maintaintain. The tester 'dolist' can be used
to verify new prompts as the variable is changed.

Jari

2009-03-29  Jari Aalto  <jari.aalto <at> cante.net>

        * comint.el (comint-password-prompt-regexp): Rewrite using
        regexp-opt. Add ssh-keygen check. Add dolist block to test new
        regexp.

[0001-lisp-comint.el-comint.el-comint-password-prompt-re.patch (text/x-diff, inline)]
From 804b37d9bdcffc4980af4f075ee804ea6a8471d2 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto <at> cante.net>
Date: Sun, 29 Mar 2009 19:13:06 +0300
Subject: [PATCH] lisp/comint.el: comint.el (comint-password-prompt-regexp): Rewrite using regexp-opt

---
 lisp/comint.el |   71 +++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 58 insertions(+), 13 deletions(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index 5bff986..155dfde 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -328,25 +328,70 @@ This variable is buffer-local."
   :type 'boolean
   :group 'comint)
 
-;; AIX puts the name of the person being su'd to in front of the prompt.
-;; kinit prints a prompt like `Password for devnull <at> GNU.ORG: '.
-;; ksu prints a prompt like `Kerberos password for devnull/root <at> GNU.ORG: '.
-;; ssh-add prints a prompt like `Enter passphrase: '.
-;; plink prints a prompt like `Passphrase for key "root <at> GNU.ORG": '.
-;; Ubuntu's sudo prompts like `[sudo] password for user:'
-;; Some implementations of passwd use "Password (again)" as the 2nd prompt.
-;; Something called "perforce" uses "Enter password:".
 (defcustom comint-password-prompt-regexp
-  "\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|\
-Kerberos \\|CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)\
-\[Pp]assword\\( (again)\\)?\\|\
-pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\
-\\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'"
+  (concat
+   "^\\("
+   (regexp-opt
+    '(;; AIX puts the name of the person being su'd to in front of the prompt.
+      "'s"
+      "Bad"
+      "CVS"
+      "Enter same"
+      "Enter"
+      "Kerberos"
+      "LDAP"
+      "Login"
+      "New"
+      "Old"
+      "Repeat"
+      "SMB"
+      "UNIX"
+      "[sudo]"
+      "bad"
+      "login"
+      "new"
+      "old"
+      "repeat"))
+   " +\\)?"
+   (regexp-opt
+    '("password"
+      "Password"
+      "passphrase"
+      "pass phrase"
+      "Passphrase"
+      "Pass phrase"))
+   "\\("
+       "\\(?:, try \\)?\\( *again\\)?\\(?: for [^:]+\\)?:\\|"
+       " (empty for no passphrase):\\|"
+       " (again)\\|"
+       " for key"
+   "\\)"
+   )
   "Regexp matching prompts for passwords in the inferior process.
 This is used by `comint-watch-for-password-prompt'."
   :type 'regexp
   :group 'comint)
 
+(when  nil
+
+  ;; Tester. Run C-x C-e at the end to test new prompts or after
+  ;; changes to comint-password-prompt-regexp
+
+  (dolist (str '("Password for devnull <at> GNU.ORG: "               ; knit
+		 "Kerberos password for devnull/root <at> GNU.ORG: " ; ksu
+		 "Enter passphrase: "				; ssh-add
+		 "Enter passphrase (empty for no passphrase): " ; ssh-keygen
+		 "Enter same passphrase again: "		; ssh-keygen
+		 "Passphrase for key root <at> GNU.ORG: "            ; plink
+		 "[sudo] password for user:"			; Ubuntu sudo
+		 ;;  some implementation of passwd(1) as the 2nd prompt
+		 "Password (again)"
+		 "Enter password:"))	                        ; perforce
+    (unless (string-match comint-password-prompt-regexp str)
+      (error "Did not match: %s" str)))
+
+  )
+
 ;; Here are the per-interpreter hooks.
 (defvar comint-get-old-input (function comint-get-old-input-default)
   "Function that returns old text in Comint mode.
-- 
1.6.1.3


Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2817; Package emacs. (Sun, 29 Mar 2009 17:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 29 Mar 2009 17:30:04 GMT) Full text and rfc822 format available.

Message #10 received at 2817 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Jari Aalto <jari.aalto <at> cante.net>
Cc: 2817 <at> debbugs.gnu.org
Subject: [PATCH] Emacs CVS: comint-password-prompt-regexp - support ssh-keygen
Date: Sun, 29 Mar 2009 13:25:43 -0400
> Added support for ssh-keygen(1) prompt and changed to new format
> because the old one was hard to decipher and keep track on.

I'd prefer a less invasive change at this stage of the release.  Could
you submit a patch that uses the old code instead of rewriting it?
Thanks.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2817; Package emacs. (Sun, 29 Mar 2009 20:50:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jari Aalto <jari.aalto <at> cante.net>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 29 Mar 2009 20:50:05 GMT) Full text and rfc822 format available.

Message #15 received at 2817 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Jari Aalto <jari.aalto <at> cante.net>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 2817 <at> debbugs.gnu.org
Subject: Re: [PATCH] Emacs CVS: comint-password-prompt-regexp - support ssh-keygen
Date: Sun, 29 Mar 2009 23:43:32 +0300
Chong Yidong <cyd <at> stupidchicken.com> writes:

>> Added support for ssh-keygen(1) prompt and changed to new format
>> because the old one was hard to decipher and keep track on.
>
> I'd prefer a less invasive change at this stage of the release.  Could
> you submit a patch that uses the old code instead of rewriting it?
> Thanks.

I couldn't read the old code.

The tester 'dolist' verifies that it matches the old settings.

Jari




Severity set to `wishlist' from `normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Thu, 02 Apr 2009 00:35:08 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from Jari Aalto <jari.aalto <at> cante.net> to control <at> emacsbugs.donarmstrong.com. (Sun, 13 Sep 2009 14:30:04 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#2817; Package emacs. (Sat, 10 Apr 2010 23:56:01 GMT) Full text and rfc822 format available.

Message #22 received at 2817 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Jari Aalto <jari.aalto <at> cante.net>
Cc: 2817 <at> debbugs.gnu.org
Subject: Re: [PATCH] Emacs CVS: comint-password-prompt-regexp - support
	ssh-keygen
Date: Sat, 10 Apr 2010 19:55:35 -0400
> Added support for ssh-keygen(1) prompt and changed to new format because
> the old one was hard to decipher and keep track on.

Thanks, I have commited the change to the trunk.




bug closed, send any further explanations to Jari Aalto <jari.aalto <at> cante.net> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sat, 10 Apr 2010 23:56:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 09 May 2010 11:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 09 Jun 2010 21:47:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#2817; Package emacs. (Wed, 09 Jun 2010 21:53:03 GMT) Full text and rfc822 format available.

Message #31 received at 2817 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 2817 <at> debbugs.gnu.org, Jari Aalto <jari.aalto <at> cante.net>
Subject: Re: [PATCH] Emacs CVS: comint-password-prompt-regexp - support
	ssh-keygen
Date: Wed, 09 Jun 2010 17:52:16 -0400
Chong Yidong wrote:

>> Added support for ssh-keygen(1) prompt and changed to new format because
>> the old one was hard to decipher and keep track on.
>
> Thanks, I have commited the change to the trunk.

This can't be right. Eg why is there now a "^" at the start of the
regexp, when there was not before?

See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6367




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#2817; Package emacs. (Fri, 11 Jun 2010 14:41:01 GMT) Full text and rfc822 format available.

Message #34 received at 2817 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 2817 <at> debbugs.gnu.org, Jari Aalto <jari.aalto <at> cante.net>
Subject: Re: [PATCH] Emacs CVS: comint-password-prompt-regexp - support
	ssh-keygen
Date: Fri, 11 Jun 2010 10:40:45 -0400
Glenn Morris <rgm <at> gnu.org> writes:

> Chong Yidong wrote:
>
>>> Added support for ssh-keygen(1) prompt and changed to new format because
>>> the old one was hard to decipher and keep track on.
>>
>> Thanks, I have commited the change to the trunk.
>
> This can't be right. Eg why is there now a "^" at the start of the
> regexp, when there was not before?
>
> See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6367

The ^ is wrong, thanks for pointing this out.  I've removed it, and
added a test for this in test/comint-testsuite.el.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 10 Jul 2010 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.