comparison lisp/utils/passwd.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents ec9a17fef872
children 4be1180a9e89
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
15 ;; XEmacs is distributed in the hope that it will be useful, but 15 ;; XEmacs is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of 16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details. 18 ;; General Public License for more details.
19 19
20 ;;; Synched up with: Not in FSF.
21
20 ;; You should have received a copy of the GNU General Public License 22 ;; You should have received a copy of the GNU General Public License
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free 23 ;; along with XEmacs; see the file COPYING. If not, write to the
22 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
23 26
24 ;;; Change Log: 27 ;;; Change Log:
25 ;; 28 ;;
26 ;; Sun Jun 12 04:19:30 1994 by sandy on ibm550.sissa.it 29 ;; Sun Jun 12 04:19:30 1994 by sandy on ibm550.sissa.it
27 ;; Added support for password histories and (provide 'passwd) 30 ;; Added support for password histories and (provide 'passwd)
100 again to confirm that they typed it correctly. 103 again to confirm that they typed it correctly.
101 If optional arg DEFAULT is provided, then it is a string to insert as 104 If optional arg DEFAULT is provided, then it is a string to insert as
102 the default choice (it is not, of course, displayed.) 105 the default choice (it is not, of course, displayed.)
103 106
104 If running under X, the keyboard will be grabbed (with XGrabKeyboard()) 107 If running under X, the keyboard will be grabbed (with XGrabKeyboard())
105 to reduce the possibility that eavesdropping is occuring. 108 to reduce the possibility that evesdropping is occuring.
106 109
107 When reading a password, all keys self-insert, except for: 110 When reading a password, all keys self-insert, except for:
108 \\<read-passwd-map> 111 \\<read-passwd-map>
109 \\[read-passwd-erase-line] Erase the entire line. 112 \\[read-passwd-erase-line] Erase the entire line.
110 \\[quoted-insert] Insert the next character literally. 113 \\[quoted-insert] Insert the next character literally.
181 passwd))) 184 passwd)))
182 ;; protected 185 ;; protected
183 (passwd-ungrab-keyboard) 186 (passwd-ungrab-keyboard)
184 (passwd-insecure-display) 187 (passwd-insecure-display)
185 (passwd-kill-buffer input) 188 (passwd-kill-buffer input)
186 (message "") 189 (if (fboundp 'clear-message) ;XEmacs
190 (clear-message)
191 (message ""))
187 )))) 192 ))))
188 193
189 194
190 (defun read-passwd-1 (buffer prompt &optional prompt2 default) 195 (defun read-passwd-1 (buffer prompt &optional prompt2 default)
191 (set-buffer buffer) 196 (set-buffer buffer)
365 ;; read-key-sequence echoes the key sequence in Emacs 18. 370 ;; read-key-sequence echoes the key sequence in Emacs 18.
366 (defun passwd-read-key-sequence (prompt) 371 (defun passwd-read-key-sequence (prompt)
367 (let ((inhibit-quit t) 372 (let ((inhibit-quit t)
368 str) 373 str)
369 (while (or (null str) (keymapp (key-binding str))) 374 (while (or (null str) (keymapp (key-binding str)))
370 (message prompt) 375 (if (fboundp 'display-message)
376 (display-message 'prompt prompt)
377 (message prompt))
371 (setq str (concat str (char-to-string (read-char))))) 378 (setq str (concat str (char-to-string (read-char)))))
372 (setq quit-flag nil) 379 (setq quit-flag nil)
373 str)) 380 str))
374 381
375 (or (string-match "^18" emacs-version) 382 (or (string-match "^18" emacs-version)