From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#13124: 24.1; shell-mode does not hide sudo password prompts Date: Thu, 13 Dec 2012 23:14:19 +0900 Message-ID: <87obhy6nus.fsf@gnu.org> References: <87zk1owu6p.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp X-Trace: ger.gmane.org 1355408245 17958 80.91.229.3 (13 Dec 2012 14:17:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Dec 2012 14:17:25 +0000 (UTC) Cc: 13124@debbugs.gnu.org To: Arne Babenhauserheide Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 13 15:17:37 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 1Tj9bS-0001r7-AX for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Dec 2012 15:17:34 +0100 Original-Received: from localhost ([::1]:52919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj9bF-0004fN-DH for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Dec 2012 09:17:21 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj9bB-0004Xg-If for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 09:17:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tj9b4-0000Pg-JU for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 09:17:17 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tj9b4-0000Pa-GF for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 09:17:10 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tj9bu-0000E1-Fk for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 09:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kenichi Handa Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Dec 2012 14:18: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.1355408256818 (code B ref 13124); Thu, 13 Dec 2012 14:18:02 +0000 Original-Received: (at 13124) by debbugs.gnu.org; 13 Dec 2012 14:17:36 +0000 Original-Received: from localhost ([127.0.0.1]:40387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tj9bT-0000D8-8h for submit@debbugs.gnu.org; Thu, 13 Dec 2012 09:17:36 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:41702) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tj9bQ-0000D0-PN for 13124@debbugs.gnu.org; Thu, 13 Dec 2012 09:17:33 -0500 Original-Received: from 253.240.accsnet.ne.jp ([202.220.240.253]:55291 helo=mongkok) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Tj9aZ-0006Oh-7V; Thu, 13 Dec 2012 09:16:39 -0500 In-Reply-To: <2937464.OIdV3OoAVt@fluss> (message from Arne Babenhauserheide on Tue, 11 Dec 2012 14:42:28 +0100) 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:68453 Archived-At: In article <2937464.OIdV3OoAVt@fluss>, Arne Babenhauserheide writes: > I installed emacs for a collegue and the visible password is the major reason > why he switches to the quite inconvenient term/ansi-term mode instead of > shell. > So I think it is very relevant: It’s a matter of good defaults to never show > the Password your user types. Especially not (quasi-)root passwords. It seems to be difficult to setup comint-password-prompt-regexp for all variations of prompts for password. How about using this kind of code (incomplete)? (defun shell-enter-password () (interactive) (let* ((inhibit-field-text-motion t) (prompt (buffer-substring (line-beginning-position) (point)))) (if (and (not (string-match comint-password-prompt-regexp prompt)) (y-or-n-p (format "Remember \"%s\" as a password prompt for the future session? " prompt))) ;; Insert a proper code to add PROMPT to comint-password-prompt-regexp ;; and save it in .emacs. nil) (send-invisible prompt))) (define-key shell-mode-map "\C-cp" 'shell-enter-password) One can type C-c p when the shell buffer displays a prompt for password without letting user enter a password in the minibuffer. --- Kenichi Handa handa@gnu.org