emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/password-cache.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/password-cache.el,v
Date: Tue, 04 Dec 2007 04:10:33 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       07/12/04 04:10:33

Index: password-cache.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/password-cache.el,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- password-cache.el   4 Dec 2007 04:09:15 -0000       1.1
+++ password-cache.el   4 Dec 2007 04:10:33 -0000       1.2
@@ -37,13 +37,6 @@
 ;; (password-cache-add "test" "foo")
 ;;  => nil
 
-;; Note the previous two can be replaced with:
-;; (password-read-and-add "Password? " "test")
-;; ;; Minibuffer prompt for password.
-;; => "foo"
-;; ;; "foo" is now cached with key "test"
-
-
 ;; (password-read "Password? " "test")
 ;; ;; No minibuffer prompt
 ;;  => "foo"
@@ -60,9 +53,6 @@
 
 ;;; Code:
 
-(eval-when-compile
-  (require 'cl))
-
 (defcustom password-cache t
   "Whether to cache passwords."
   :group 'password
@@ -97,14 +87,20 @@
 (defun password-read-and-add (prompt &optional key)
   "Read password, for use with KEY, from user, or from cache if wanted.
 Then store the password in the cache.  Uses `password-read' and
-`password-cache-add'.
-Custom variables `password-cache' and `password-cache-expiry'
-regulate cache behavior."
+`password-cache-add'.  Custom variables `password-cache' and
+`password-cache-expiry' regulate cache behavior.
+
+Warning: the password is cached without checking that it is
+correct.  It is better to check the password before caching.  If
+you must use this function, take care to check passwords and
+remove incorrect ones from the cache."
   (let ((password (password-read prompt key)))
     (when (and password key)
       (password-cache-add key password))
     password))
 
+(make-obsolete 'password-read-and-add 'password-read "23.1")
+
 (defun password-cache-remove (key)
   "Remove password indexed by KEY from password cache.
 This is typically run be a timer setup from `password-cache-add',
@@ -121,8 +117,7 @@
 
 (defun password-cache-add (key password)
   "Add password to cache.
-The password is removed by a timer after `password-cache-expiry'
-seconds."
+The password is removed by a timer after `password-cache-expiry' seconds."
   (when (and password-cache-expiry (null (intern-soft key password-data)))
     (run-at-time password-cache-expiry nil
                 #'password-cache-remove




reply via email to

[Prev in Thread] Current Thread [Next in Thread]