all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [patch] Prevent passwords from being display in shell mode
@ 2004-10-10  8:31 Jérôme Marant
  2004-10-11  6:18 ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Jérôme Marant @ 2004-10-10  8:31 UTC (permalink / raw)



Hi,

Current shell.el does not protect password. Here is a patch.

Cheers,

diff -ur emacs.orig/lisp/ChangeLog emacs/lisp/ChangeLog
--- emacs.orig/lisp/ChangeLog	2004-10-10 10:14:11.000000000 +0200
+++ emacs/lisp/ChangeLog	2004-10-10 10:24:04.000000000 +0200
@@ -1,3 +1,8 @@
+2004-10-10  Jérôme Marant  <jerome@debian.org>  (tiny change)
+
+	* shell.el (shell-mode): Prevent passwords from being
+	displayed.
+
 2004-10-09  Kim F. Storm  <storm@cua.dk>
 
 	* subr.el (progress-reporter-update): Define before first usage.
diff -ur emacs.orig/lisp/shell.el emacs/lisp/shell.el
--- emacs.orig/lisp/shell.el	2004-10-10 10:16:28.000000000 +0200
+++ emacs/lisp/shell.el	2004-10-10 10:21:02.000000000 +0200
@@ -433,6 +433,8 @@
   (make-local-variable 'shell-dirtrackp)
   (setq shell-dirtrackp t)
   (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)
+  ;; Prevent passwords from being displayed
+  (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt)
   (setq comint-input-autoexpand shell-input-autoexpand)
   ;; This is not really correct, since the shell buffer does not really
   ;; edit this directory.  But it is useful in the buffer list and menus.


-- 
Jérôme Marant

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

* Re: [patch] Prevent passwords from being display in shell mode
  2004-10-10  8:31 [patch] Prevent passwords from being display in shell mode Jérôme Marant
@ 2004-10-11  6:18 ` Richard Stallman
  2004-10-13 12:51   ` Jérôme Marant
  2004-10-15 18:43   ` Detlev Zundel
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Stallman @ 2004-10-11  6:18 UTC (permalink / raw)
  Cc: emacs-devel

Does anyone see a problem in this patch?
One thing I wonder about is whether it is reliable enough
in recognizing when to operate.

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

* Re: [patch] Prevent passwords from being display in shell mode
  2004-10-11  6:18 ` Richard Stallman
@ 2004-10-13 12:51   ` Jérôme Marant
  2004-10-15 18:43   ` Detlev Zundel
  1 sibling, 0 replies; 4+ messages in thread
From: Jérôme Marant @ 2004-10-13 12:51 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> Does anyone see a problem in this patch?
> One thing I wonder about is whether it is reliable enough
> in recognizing when to operate.

I noticed this in the Emacs manual (shell mode):

-=-=-=-=-
M-x send-invisible <RET> text <RET> Send text as input to the shell,
    after reading it without echoing. This is useful when a shell
    command runs a program that asks for a password.

    Alternatively, you can arrange for Emacs to notice password
    prompts and turn off echoing for them, as follows:

          (add-hook 'comint-output-filter-functions
                    'comint-watch-for-password-prompt)
-=-=-=-=-

My patch adds the hook whenever the shell mode is activated.
(comint-output-filter-functions is buffer-local, so I guess
there is no clash with other modes using comint as well?)

Why isn't it so by default?

Thanks.       

-- 
Jérôme Marant
http://marant.org

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

* Re: [patch] Prevent passwords from being display in shell mode
  2004-10-11  6:18 ` Richard Stallman
  2004-10-13 12:51   ` Jérôme Marant
@ 2004-10-15 18:43   ` Detlev Zundel
  1 sibling, 0 replies; 4+ messages in thread
From: Detlev Zundel @ 2004-10-15 18:43 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> wrote:

> Does anyone see a problem in this patch?
> One thing I wonder about is whether it is reliable enough
> in recognizing when to operate.

I don't see a problem - on the contrary.  Let's define this as a
default behaviour so it will be a bug when a situation is not
discovered correctly.  Offhand I can't remember a situation where it
failed.

Thanks
  Detlev

--
Test applications  with a variety of tools.  Don't assume everything works if
you've tested  with only  one client.  Also, assume the low end of technology
for clients and don't create applications which can only be used by Graphical
User Interfaces.                                       -- RFC 1855

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

end of thread, other threads:[~2004-10-15 18:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-10  8:31 [patch] Prevent passwords from being display in shell mode Jérôme Marant
2004-10-11  6:18 ` Richard Stallman
2004-10-13 12:51   ` Jérôme Marant
2004-10-15 18:43   ` Detlev Zundel

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.