From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#13124: 24.1; shell-mode does not hide sudo password prompts Date: Sat, 29 Dec 2012 15:38:09 +0800 Message-ID: <87k3s1fgv2.fsf@gnu.org> References: <87zk1owu6p.fsf@web.de> <1624103.WhpMEyUi7x@fluss> <2651799.fvDoQSk02G@fluss> <877gocj6rn.fsf@gnu.org> <87k3sbjyau.fsf@gnu.org> <87txrfsd0y.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1356766758 17936 80.91.229.3 (29 Dec 2012 07:39:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Dec 2012 07:39:18 +0000 (UTC) Cc: 13124@debbugs.gnu.org, Arne Babenhauserheide To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 29 08:39:31 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tor0z-0001J6-Nd for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2012 08:39:29 +0100 Original-Received: from localhost ([::1]:47548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tor0l-0002e3-02 for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Dec 2012 02:39:15 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tor0f-0002dg-SK for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 02:39:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tor0d-00062n-5t for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 02:39:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tor0d-00062j-1B for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 02:39:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tor1X-00047v-84 for bug-gnu-emacs@gnu.org; Sat, 29 Dec 2012 02:40:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Dec 2012 07:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13124 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13124-submit@debbugs.gnu.org id=B13124.135676678415830 (code B ref 13124); Sat, 29 Dec 2012 07:40:02 +0000 Original-Received: (at 13124) by debbugs.gnu.org; 29 Dec 2012 07:39:44 +0000 Original-Received: from localhost ([127.0.0.1]:35515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tor1D-000479-46 for submit@debbugs.gnu.org; Sat, 29 Dec 2012 02:39:43 -0500 Original-Received: from mail-pa0-f49.google.com ([209.85.220.49]:57646) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tor19-000471-H8 for 13124@debbugs.gnu.org; Sat, 29 Dec 2012 02:39:41 -0500 Original-Received: by mail-pa0-f49.google.com with SMTP id bi1so6369192pad.22 for <13124@debbugs.gnu.org>; Fri, 28 Dec 2012 23:38:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=a48Grhs/sPGtfY1zIv6D+oL0qwrc4zGWAiefQQgCQRo=; b=gXthBt2Gvs2xB/KZblzcfsD2Blz7vUmNF+6BM5GKqVyL+J0jmtmDxnPWzJ1MOKe0y0 XmQBj6UeeB5+8XynXmGNrmF5Q2w631wpc4K0slym+6lJYzEYPzVC3hHLTfpTFJD/gzp3 Y17NSa/sz+1CkhfaRHjUbTWYSR5Zd6XskRvY1lGmli27hBSE0MtwaLm+fo1FCWDVbGh3 tkuASyZtrr/W53qGJqkbdo1mJayIp7V7R6p23Sxd4d0xQiPzmcMjDfv2CMPva9QlcdYM X10h5/XxJAVd8Q2xDgJkjqG94bxxTHdMHFZzTl/7qsPaR5fOyTaqRYLnNwh4MzDRdXbB yEZg== X-Received: by 10.66.80.202 with SMTP id t10mr104796733pax.81.1356766721718; Fri, 28 Dec 2012 23:38:41 -0800 (PST) Original-Received: from ulysses (cm107.delta179.maxonline.com.sg. [59.189.179.107]) by mx.google.com with ESMTPS id ou3sm21047770pbb.46.2012.12.28.23.38.18 (version=SSLv3 cipher=OTHER); Fri, 28 Dec 2012 23:38:40 -0800 (PST) In-Reply-To: <87txrfsd0y.fsf@gmx.de> (Michael Albinus's message of "Fri, 21 Dec 2012 15:19:57 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.91 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:69141 Archived-At: Michael Albinus writes: >> How is that different from having an ad-hoc list of "password" words, >> other than being more difficult to implement? > > Other packages could profit from a predefined list of "password" words > as well. Tramp comes to my mind ... Anyone have objections to the following patch? It introduces a new option `password-word-equivalents' for this purpose. =3D=3D=3D modified file 'lisp/comint.el' *** lisp/comint.el 2012-12-27 07:33:47 +0000 --- lisp/comint.el 2012-12-29 07:34:16 +0000 *************** *** 346,356 **** "Old" "old" "New" "new" "'s" "login" "Kerberos" "CVS" "UNIX" " SMB" "LDAP" "[sudo]" "Repeat" "Bad") t) " +\\)" ! (regexp-opt ! '("password" "Password" "passphrase" "Passphrase" ! "pass phrase" "Pass phrase" "Response")) "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)= ?\ ! \\(?: for [^:]+\\)?:\\s *\\'") "Regexp matching prompts for passwords in the inferior process. This is used by `comint-watch-for-password-prompt'." :version "24.1" --- 346,354 ---- "Old" "old" "New" "new" "'s" "login" "Kerberos" "CVS" "UNIX" " SMB" "LDAP" "[sudo]" "Repeat" "Bad") t) " +\\)" ! "\\(?:" (regexp-opt password-word-equivalents) "\\|Response\\)" "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)= ?\ ! \\(?: for [^:]+\\)?[:=EF=BC=9A=E1=9F=96]\\s *\\'") "Regexp matching prompts for passwords in the inferior process. This is used by `comint-watch-for-password-prompt'." :version "24.1" *************** *** 2315,2321 **** `comint-password-prompt-regexp'. =20=20 This function could be in the list `comint-output-filter-functions'." ! (when (string-match comint-password-prompt-regexp string) (when (string-match "^[ \n\r\t\v\f\b\a]+" string) (setq string (replace-match "" t t string))) (send-invisible string))) --- 2313,2320 ---- `comint-password-prompt-regexp'. =20=20 This function could be in the list `comint-output-filter-functions'." ! (when (let ((case-fold-search t)) ! (string-match comint-password-prompt-regexp string)) (when (string-match "^[ \n\r\t\v\f\b\a]+" string) (setq string (replace-match "" t t string))) (send-invisible string))) =3D=3D=3D modified file 'lisp/simple.el' *** lisp/simple.el 2012-12-21 08:10:26 +0000 --- lisp/simple.el 2012-12-29 07:34:03 +0000 *************** *** 2214,2219 **** --- 2214,2277 ---- (setq buffer-undo-list nil) t)) + (defcustom password-word-equivalents + '("password" "passphrase" "pass phrase" + "=D9=83=D9=84=D9=85=D8=A9 =D8=A7=D9=84=D8=B3=D8=B1" ; ar + "=E0=A6=97=E0=A7=81=E0=A6=AA=E0=A7=8D=E0=A6=A4=E0=A6=B6=E0=A6=AC=E0= =A7=8D=E0=A6=A6" ; as + "=E0=A6=AA=E0=A6=BE=E0=A6=B8=E0=A6=93=E0=A7=9F=E0=A6=BE=E0=A6=B0=E0= =A7=8D=E0=A6=A1" ; bn_IN + "contrasenya" ; ca + "heslo" ; cs + "adgangskode" ; da + "passwort" ; de + "pasvorto" ; eo + "contrase=C3=B1a" ; es + "pasahitza" ; eu + "salasana" ; fi + "mot de passe" ; fr + "=E0=AA=AA=E0=AA=BE=E0=AA=B8=E0=AA=B5=E0=AA=B0=E0=AB=8D=E0=AA=A1" = ; gu + "=D7=A1=D7=A1=D7=9E=D7=94" ; he + "=E0=A4=B6=E0=A4=AC=E0=A5=8D=E0=A4=A6=E0=A4=95=E0=A5=82=E0=A4=9F" = ; hi + "lozinka" ; hr + "Jelsz=C3=B3: " ; hu + "=E3=83=91=E3=82=B9=E3=83=AF=E3=83=BC=E3=83=89" ; ja + "=D0=9F=D0=B0=D1=80=D0=BE=D0=BB=D1=8C" ; kk + "=E0=B2=97=E0=B3=81=E0=B2=AA=E0=B3=8D=E0=B2=A4=E0=B2=AA=E0=B2=A6" = ; kn + "=EC=95=94=ED=98=B8" ; ko + "=E1=9E=96=E1=9E=B6=E1=9E=80=E1=9F=92=E1=9E=99=E1=9E=9F=E1=9E=98=E1= =9F=92=E1=9E=84=E1=9E=B6=E1=9E=8F=E1=9F=8B" ; km + "slapta=C5=BEodis" ; lt + "=E0=B4=85=E0=B4=9F=E0=B4=AF=E0=B4=BE=E0=B4=B3=E0=B4=B5=E0=B4=BE=E0= =B4=95=E0=B5=8D=E0=B4=95=E0=B5=8D" ; ml + "=E0=A4=97=E0=A5=81=E0=A4=AA=E0=A5=8D=E0=A4=A4=E0=A4=B6=E0=A4=AC=E0= =A5=8D=E0=A4=A6" ; mr + "passord" ; nb + "wachtwoord" ; nl + "=E0=AC=AA=E0=AD=8D=E0=AC=B0=E0=AC=AC=E0=AD=87=E0=AC=B6 =E0=AC=B8=E0= =AC=99=E0=AD=8D=E0=AC=95=E0=AD=87=E0=AC=A4" ; or + "=E0=A8=AA=E0=A8=BE=E0=A8=B8=E0=A8=B5=E0=A8=B0=E0=A8=A1" ; pa + "has=C5=82o" ; pl + "senha" ; pt + "=D0=9F=D0=B0=D1=80=D0=BE=D0=BB=D1=8C" ; ru + "=E0=B6=BB=E0=B7=84=E0=B7=83=E0=B7=8A=E0=B6=B4=E0=B6=AF=E0=B6=BA" = ; si + "Heslo" ; sk + "geslo" ; sl + "lozinka" ; sr + "=D0=9B=D0=BE=D0=B7=D0=B8=D0=BD=D0=BA=D0=B0" ; sr + "l=C3=B6senord" ; sv + "=E0=AE=95=E0=AE=9F=E0=AE=B5=E0=AF=81=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0= =AF=8A=E0=AE=B2=E0=AF=8D" ; ta + "=E0=B0=B8=E0=B0=82=E0=B0=95=E0=B1=87=E0=B0=A4=E0=B0=AA=E0=B0=A6=E0= =B0=AE=E0=B1=81" ; te + "parola" ; tr + "=D0=9F=D0=B0=D1=80=D0=BE=D0=BB=D1=8C" ; uk + "M=E1=BA=ADt kh=E1=BA=A9u" ; vi + "=E5=AF=86=E7=A0=81" ; zh_CN + "=E5=AF=86=E7=A2=BC" ; zh_TW + "iphasiwedi" ; zu + ) + "List of words equivalent to \"password\". + This is used by Shell mode and other parts of Emacs to recognize + password prompts, including prompts in languages other than + English. Different case choices should not be assumed to be + included; callers should bind `case-fold-search' to t." + :type '(repeat string) + :version "24.4" + :group 'processes) +=20 (defvar shell-command-history nil "History list for some commands that read shell commands. =20=20