summaryrefslogtreecommitdiff
path: root/lisp/auth-source.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2022-08-22 16:56:57 +0200
committerMichael Albinus <michael.albinus@gmx.de>2022-08-22 16:56:57 +0200
commitf579cd472cbf3d9af52c87b65473b56ce918abba (patch)
treec473db135f3a41f0005f137db6c1d2a49da0b631 /lisp/auth-source.el
parent6c9696e3de171d84c4241d95872b83977cd44593 (diff)
downloademacs-f579cd472cbf3d9af52c87b65473b56ce918abba.tar.gz
auth-source: Fix wrong-type-argument when searching secret services
`auth-source-search' can be called with an integer port number, while the backend implementation doesn't allow non-string attributes. * doc/misc/auth.texi (Secret Service API): Attribute values are stringified. * lisp/auth-source.el (auth-source-secrets-search): Ensure attributes are string. (Bug#55199)
Diffstat (limited to 'lisp/auth-source.el')
-rw-r--r--lisp/auth-source.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index f198362f106..c79e5b81f76 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -1618,10 +1618,13 @@ authentication tokens:
(search-specs (auth-source-secrets-listify-pattern
(apply #'append (mapcar
(lambda (k)
- (if (or (null (plist-get spec k))
- (eq t (plist-get spec k)))
- nil
- (list k (plist-get spec k))))
+ (let ((v (plist-get spec k)))
+ (if (or (null v)
+ (eq t v))
+ nil
+ (list
+ k
+ (auth-source-ensure-strings v)))))
search-keys))))
;; needed keys (always including host, login, port, and secret)
(returned-keys (delete-dups (append