emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r105854: password-cache.el (password-


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105854: 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.
Date: Tue, 20 Sep 2011 14:08:04 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105854
author: Julien Danjou <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Tue 2011-09-20 14:08:04 +0000
message:
  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.
modified:
  lisp/ChangeLog
  lisp/gnus/ChangeLog
  lisp/gnus/auth-source.el
  lisp/password-cache.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-09-20 04:12:05 +0000
+++ b/lisp/ChangeLog    2011-09-20 14:08:04 +0000
@@ -1,3 +1,9 @@
+2011-09-20  Julien Danjou  <address@hidden>
+
+       * 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.
+
 2011-09-20  Lawrence Mitchell  <address@hidden>
 
        * progmodes/f90.el (f90-break-line): If breaking inside comment delete

=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-09-20 00:21:58 +0000
+++ b/lisp/gnus/ChangeLog       2011-09-20 14:08:04 +0000
@@ -1,3 +1,7 @@
+2011-09-20  Julien Danjou  <address@hidden>
+
+       * auth-source.el (auth-source-format-cache-entry): New function.
+
 2011-09-20  Katsumi Yamaoka  <address@hidden>
 
        * gnus-fun.el (gnus-convert-image-to-x-face-command): Doc fix.

=== modified file 'lisp/gnus/auth-source.el'
--- a/lisp/gnus/auth-source.el  2011-09-19 22:06:57 +0000
+++ b/lisp/gnus/auth-source.el  2011-09-20 14:08:04 +0000
@@ -749,28 +749,31 @@
         do (password-cache-remove (symbol-name sym)))
   (setq auth-source-netrc-cache nil))
 
+(defun auth-source-format-cache-entry (spec)
+  "Format SPEC entry to put it in the password cache."
+  (concat auth-source-magic (format "%S" spec)))
+
 (defun auth-source-remember (spec found)
   "Remember FOUND search results for SPEC."
   (let ((password-cache-expiry auth-source-cache-expiry))
     (password-cache-add
-     (concat auth-source-magic (format "%S" spec)) found)))
+     (auth-source-format-cache-entry spec) found)))
 
 (defun auth-source-recall (spec)
   "Recall FOUND search results for SPEC."
-  (password-read-from-cache
-   (concat auth-source-magic (format "%S" spec))))
+  (password-read-from-cache (auth-source-format-cache-entry spec)))
 
 (defun auth-source-remembered-p (spec)
   "Check if SPEC is remembered."
   (password-in-cache-p
-   (concat auth-source-magic (format "%S" spec))))
+   (auth-source-format-cache-entry spec)))
 
 (defun auth-source-forget (spec)
   "Forget any cached data matching SPEC exactly.
 
 This is the same SPEC you passed to `auth-source-search'.
 Returns t or nil for forgotten or not found."
-  (password-cache-remove (concat auth-source-magic (format "%S" spec))))
+  (password-cache-remove (auth-source-format-cache-entry spec)))
 
 ;;; (loop for sym being the symbols of password-data when (string-match 
(concat "^" auth-source-magic) (symbol-name sym)) collect (symbol-name sym))
 

=== modified file 'lisp/password-cache.el'
--- a/lisp/password-cache.el    2011-03-03 13:21:50 +0000
+++ b/lisp/password-cache.el    2011-09-20 14:08:04 +0000
@@ -116,13 +116,14 @@
 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.


reply via email to

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