Synch with the trunk.
authorueno <ueno>
Wed, 6 Feb 2008 02:49:30 +0000 (02:49 +0000)
committerueno <ueno>
Wed, 6 Feb 2008 02:49:30 +0000 (02:49 +0000)
ChangeLog
epa-file.el

index 26287b5..ea35b9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
-2008-02-05  Daiki Ueno  <ueno@unixuser.org>
+2008-02-06  Daiki Ueno  <ueno@unixuser.org>
 
-       * epg.el: Reverted a change by Hiroya Murata on 2006-11-22.
-       * epa.el: Reverted a change by Hiroya Murata on 2006-12-20.
+       * epa-file.el (epa-file-passphrase-callback-function): Use
+       canonical file names as keys for cache.
 
 2008-01-22  Daiki Ueno  <ueno@unixuser.org>
 
index 4dc3ffd..551a7a0 100644 (file)
@@ -105,18 +105,21 @@ May either be a string or a list of strings.")
 (defun epa-file-passphrase-callback-function (context key-id file)
   (if (and epa-file-cache-passphrase-for-symmetric-encryption
           (eq key-id 'SYM))
-      (let ((entry (assoc file epa-file-passphrase-alist))
-           passphrase)
-       (or (copy-sequence (cdr entry))
-           (progn
-             (unless entry
-               (setq entry (list file)
-                     epa-file-passphrase-alist (cons entry
-                                                epa-file-passphrase-alist)))
-             (setq passphrase (epa-passphrase-callback-function context
-                                                                key-id nil))
-             (setcdr entry (copy-sequence passphrase))
-             passphrase)))
+      (progn
+       (setq file (file-truename file))
+       (let ((entry (assoc file epa-file-passphrase-alist))
+             passphrase)
+         (or (copy-sequence (cdr entry))
+             (progn
+               (unless entry
+                 (setq entry (list file)
+                       epa-file-passphrase-alist
+                       (cons entry
+                             epa-file-passphrase-alist)))
+               (setq passphrase (epa-passphrase-callback-function context
+                                                                  key-id nil))
+               (setcdr entry (copy-sequence passphrase))
+               passphrase))))
     (epa-passphrase-callback-function context key-id nil)))
 
 (defun epa-file-handler (operation &rest args)