commit c6ee274013a64c0b8155fd0d6d694fe5fcb5cf1b
parent 33ffbe9942efeccb22cbf3dc18867d3e7ced0ca9
Author: Vineet Kumar <git@vineetk.net>
Date: Sun, 31 May 2026 14:40:19 -0400
ignore invalid :host parameter not matching */*
falls back to :user field such as when smtpmail uses it
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kasi-auth-source.el b/kasi-auth-source.el
@@ -27,8 +27,9 @@
;; (auth-source-forget-all-cached)
;;
;; The kasi file path (e.g. "category/file") is matched against the
-;; `:host' parameter. The `:user' parameter can optionally be used to
-;; filter by the username stored in the kasi entry.
+;; `:host' parameter only if it contains a "/" (i.e. looks like a
+;; directory path). Otherwise the `:host' is ignored and the search
+;; falls back to matching by `:user'.
;;; Code:
@@ -78,7 +79,7 @@ optional filters."
(dolist (file files)
(message "kasi-auth-source: checking %s" file)
(when-let* ((short-name (kasi--filename-short file))
- ((or (not host) (string= short-name host)))
+ ((or (not host) (not (string-match-p "/" host)) (string= short-name host)))
(entry-user (kasi--get file 'username))
(entry-email (kasi--get file 'email))
((or (not user) (string= entry-user user)))