summaryrefslogtreecommitdiff
path: root/lisp/auth-source.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2025-10-08 16:09:15 +0200
committerMichael Albinus <michael.albinus@gmx.de>2025-10-08 16:09:15 +0200
commitebcebaed69cbb2fa0e7206cb3dda910aca452d3b (patch)
treef387a3d1369f9c5f08318475c5587cbd94ab7250 /lisp/auth-source.el
parentfb58ccfdc4ad7c4f0140b0b1a3cf27bcfe387b69 (diff)
Fix another inconsistency in auth-source.el
* lisp/auth-source.el (auth-source-backends): Filter out backends with type `ignore'. (auth-source-search-spec): Use `_' in `and-let*'
Diffstat (limited to 'lisp/auth-source.el')
-rw-r--r--lisp/auth-source.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index 402f2617ca8..a06c9820060 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -376,8 +376,14 @@ soon as a function returns non-nil.")
(defmacro auth-source-backends ()
"List of usable backends from `auth-sources'.
+Filter out backends with type `ignore'.
A fallback backend is added to ensure, that at least `read-passwd' is called."
- `(or (mapcar #'auth-source-backend-parse auth-sources)
+ `(or (seq-keep
+ (lambda (entry)
+ (and-let* ((backend (auth-source-backend-parse entry))
+ ((not (eq (slot-value backend 'type) 'ignore)))
+ backend)))
+ auth-sources)
;; Fallback.
(list (auth-source-backend
:source ""
@@ -407,9 +413,9 @@ A fallback backend is added to ensure, that at least `read-passwd' is called."
If a search key is nil or t (match anything), skip it."
`(apply #'append (mapcar
(lambda (k)
- (and-let* ((v (plist-get ,spec k))
- ((not (eq t v)))
- ((list k (auth-source-ensure-strings v))))))
+ (when-let* ((v (plist-get ,spec k))
+ (_ (not (eq t v))))
+ (list k (auth-source-ensure-strings v))))
(auth-source-search-keys ,spec))))
(defcustom auth-source-ignore-non-existing-file t