summaryrefslogtreecommitdiff
path: root/lisp/password-cache.el
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2011-09-20 14:08:04 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2011-09-20 14:08:04 +0000
commitcf499a1a42695fb0ce3aee0b1e6b48a3078ddca3 (patch)
treed4973e4d904193fd4984e926b8172ef07f07ffbb /lisp/password-cache.el
parente4bd0584194ca5d0a933b20a207b5ad0395a07a6 (diff)
downloademacs-cf499a1a42695fb0ce3aee0b1e6b48a3078ddca3.tar.gz
password-cache.el (password-cache-remove): Remove entries even if the value is nil, so that password with a nil value (negative caching) is possible to invalidate.
auth-source.el (auth-source-format-cache-entry): New function.
Diffstat (limited to 'lisp/password-cache.el')
-rw-r--r--lisp/password-cache.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/password-cache.el b/lisp/password-cache.el
index 941428d5291..c425e0aa7e8 100644
--- a/lisp/password-cache.el
+++ b/lisp/password-cache.el
@@ -116,13 +116,14 @@ but can be invoked at any time to forcefully remove passwords
from the cache. This may be useful when it has been detected
that a password is invalid, so that `password-read' query the
user again."
- (let ((password (symbol-value (intern-soft key password-data))))
- (when password
- (when (stringp password)
- (if (fboundp 'clear-string)
- (clear-string password)
- (fillarray password ?_)))
- (unintern key password-data))))
+ (let ((sym (intern-soft key password-data)))
+ (when sym
+ (let ((password (symbol-value sym)))
+ (when (stringp password)
+ (if (fboundp 'clear-string)
+ (clear-string password)
+ (fillarray password ?_)))
+ (unintern key password-data)))))
(defun password-cache-add (key password)
"Add password to cache.