Subject: bug#67937: 30.0.50; auth-source-pass relies on epa-file being enabled

From: Michael Albinus <[email-masked]>
Date: Fri, 22 Nov 2024 16:59:33 +0100

Michael Albinus <[email-masked]> writes:

Hi Arsen,

>> I'd also love to hear from the authors of auth-source-pass.
>
> Sure. I don't use auth-source-pass myself,

Trying to be more constructive: what about the appended patch? It should
fix the problem reported here, and it is simple.

Best regards, Michael.

diff --git a/lisp/auth-source-pass.el b/lisp/auth-source-pass.el
index 08abcf6b572..1a741a1b696 100644
--- a/lisp/auth-source-pass.el
+++ b/lisp/auth-source-pass.el
@@ -195,10 +195,15 @@ auth-source-pass--get-attr
 (defun auth-source-pass--read-entry (entry)
   "Return a string with the file content of ENTRY."
   (with-temp-buffer
-    (insert-file-contents (expand-file-name
-                           (format "%s.gpg" entry)
-                           auth-source-pass-filename))
-    (buffer-substring-no-properties (point-min) (point-max))))
+    ;; `file-name-handler-alist' could be nil, or miss the
+    ;; `epa-file-handler' entry.  We ensure, that it does exist.
+    ;; (Bug#67937)
+    (let ((file-name-handler-alist
+           (cons epa-file-handler file-name-handler-alist)))
+      (insert-file-contents (expand-file-name
+                             (format "%s.gpg" entry)
+                             auth-source-pass-filename))
+      (buffer-substring-no-properties (point-min) (point-max)))))

 (defun auth-source-pass-parse-entry (entry)
   "Return an alist of the data associated with ENTRY.