From: ueno Date: Wed, 6 Feb 2008 02:26:27 +0000 (+0000) Subject: * epa-file.el (epa-file-passphrase-callback-function): Use X-Git-Tag: emacs-merge-branchpoint~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=961ed799600a7ba0aa13695c9ce860043c3c91a0;p=elisp%2Fepg.git * epa-file.el (epa-file-passphrase-callback-function): Use canonical file names as keys for cache. --- diff --git a/ChangeLog b/ChangeLog index 5d662ce..6f82cc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-06 Daiki Ueno + + * epa-file.el (epa-file-passphrase-callback-function): Use + canonical file names as keys for cache. + 2008-01-22 Daiki Ueno * epa-mail.el (epa-mail--find-usable-key): New function. diff --git a/epa-file.el b/epa-file.el index 4dc3ffd..551a7a0 100644 --- a/epa-file.el +++ b/epa-file.el @@ -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)