diff options
| author | Glenn Morris | 2014-06-26 15:00:42 -0400 |
|---|---|---|
| committer | Glenn Morris | 2014-06-26 15:00:42 -0400 |
| commit | 64c3533166e1fa517422f89f953cfdaea6ee7bf0 (patch) | |
| tree | b317a5770db12cd74bbef35757965878b88b158e | |
| parent | 2493e35c369caabf6a65e376fd0399e95b588bfd (diff) | |
| download | emacs-64c3533166e1fa517422f89f953cfdaea6ee7bf0.tar.gz emacs-64c3533166e1fa517422f89f953cfdaea6ee7bf0.zip | |
Warn about read-passwd in batch mode
* doc/lispref/minibuf.texi (Intro to Minibuffers): Batch mode is basic.
(Reading a Password): Mention batch mode.
* lisp/subr.el (read-passwd): Warn about batch mode.
Fixes: debbugs:17839
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 7 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/subr.el | 7 |
4 files changed, 20 insertions, 3 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 4610c33796a..6b673e7f329 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-06-26 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * minibuf.texi (Intro to Minibuffers): Batch mode is basic. | ||
| 4 | (Reading a Password): Mention batch mode. (Bug#17839) | ||
| 5 | |||
| 1 | 2014-06-21 Eli Zaretskii <eliz@gnu.org> | 6 | 2014-06-21 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * positions.texi (Screen Lines): Clarify how columns are counted | 8 | * positions.texi (Screen Lines): Clarify how columns are counted |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 5b4e29c57a3..4a94f41d732 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -101,7 +101,9 @@ the minibuffer is in a separate frame. @xref{Minibuffers and Frames}. | |||
| 101 | 101 | ||
| 102 | When Emacs is running in batch mode, any request to read from the | 102 | When Emacs is running in batch mode, any request to read from the |
| 103 | minibuffer actually reads a line from the standard input descriptor that | 103 | minibuffer actually reads a line from the standard input descriptor that |
| 104 | was supplied when Emacs was started. | 104 | was supplied when Emacs was started. This supports only basic input: |
| 105 | none of the special minibuffer features (history, completion, | ||
| 106 | password hiding, etc.) are available in batch mode. | ||
| 105 | 107 | ||
| 106 | @node Text from Minibuffer | 108 | @node Text from Minibuffer |
| 107 | @section Reading Text Strings with the Minibuffer | 109 | @section Reading Text Strings with the Minibuffer |
| @@ -2123,7 +2125,8 @@ function @code{read-passwd}. | |||
| 2123 | @defun read-passwd prompt &optional confirm default | 2125 | @defun read-passwd prompt &optional confirm default |
| 2124 | This function reads a password, prompting with @var{prompt}. It does | 2126 | This function reads a password, prompting with @var{prompt}. It does |
| 2125 | not echo the password as the user types it; instead, it echoes @samp{.} | 2127 | not echo the password as the user types it; instead, it echoes @samp{.} |
| 2126 | for each character in the password. | 2128 | for each character in the password. (Note that in batch mode, the |
| 2129 | input is not hidden.) | ||
| 2127 | 2130 | ||
| 2128 | The optional argument @var{confirm}, if non-@code{nil}, says to read the | 2131 | The optional argument @var{confirm}, if non-@code{nil}, says to read the |
| 2129 | password twice and insist it must be the same both times. If it isn't | 2132 | password twice and insist it must be the same both times. If it isn't |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c8f118c8a3..0cc5b7fe71c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-06-26 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * subr.el (read-passwd): Warn about batch mode. (Bug#17839) | ||
| 4 | |||
| 1 | 2014-06-26 Daiki Ueno <ueno@gnu.org> | 5 | 2014-06-26 Daiki Ueno <ueno@gnu.org> |
| 2 | 6 | ||
| 3 | * emacs-lisp/package.el (package--check-signature): | 7 | * emacs-lisp/package.el (package--check-signature): |
diff --git a/lisp/subr.el b/lisp/subr.el index 700c072a81b..ac0e130b4e0 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2006,6 +2006,7 @@ If optional CONFIRM is non-nil, read the password twice to make sure. | |||
| 2006 | Optional DEFAULT is a default password to use instead of empty input. | 2006 | Optional DEFAULT is a default password to use instead of empty input. |
| 2007 | 2007 | ||
| 2008 | This function echoes `.' for each character that the user types. | 2008 | This function echoes `.' for each character that the user types. |
| 2009 | Note that in batch mode, the input is not hidden! | ||
| 2009 | 2010 | ||
| 2010 | Once the caller uses the password, it can erase the password | 2011 | Once the caller uses the password, it can erase the password |
| 2011 | by doing (clear-string STRING)." | 2012 | by doing (clear-string STRING)." |
| @@ -2045,7 +2046,11 @@ by doing (clear-string STRING)." | |||
| 2045 | (add-hook 'after-change-functions hide-chars-fun nil 'local)) | 2046 | (add-hook 'after-change-functions hide-chars-fun nil 'local)) |
| 2046 | (unwind-protect | 2047 | (unwind-protect |
| 2047 | (let ((enable-recursive-minibuffers t)) | 2048 | (let ((enable-recursive-minibuffers t)) |
| 2048 | (read-string prompt nil t default)) ; t = "no history" | 2049 | (read-string |
| 2050 | (if noninteractive | ||
| 2051 | (format "%s[INPUT WILL NOT BE HIDDEN!] " prompt) ; bug#17839 | ||
| 2052 | prompt) | ||
| 2053 | nil t default)) ; t = "no history" | ||
| 2049 | (when (buffer-live-p minibuf) | 2054 | (when (buffer-live-p minibuf) |
| 2050 | (with-current-buffer minibuf | 2055 | (with-current-buffer minibuf |
| 2051 | ;; Not sure why but it seems that there might be cases where the | 2056 | ;; Not sure why but it seems that there might be cases where the |