diff options
| author | Vineet Kumar <git@vineetk.net> | 2026-05-31 14:40:19 -0400 |
|---|---|---|
| committer | Vineet Kumar <git@vineetk.net> | 2026-05-31 14:40:19 -0400 |
| commit | c6ee274013a64c0b8155fd0d6d694fe5fcb5cf1b (patch) | |
| tree | 6bb9631109a41ce913ccac54a6a4134b0447a2dc | |
| parent | 33ffbe9942efeccb22cbf3dc18867d3e7ced0ca9 (diff) | |
ignore invalid :host parameter not matching */*v1.1.1
falls back to :user field such as when smtpmail uses it
| -rw-r--r-- | kasi-auth-source.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kasi-auth-source.el b/kasi-auth-source.el index fa9f629..5d720cc 100644 --- a/kasi-auth-source.el +++ b/kasi-auth-source.el | |||
| @@ -27,8 +27,9 @@ | |||
| 27 | ;; (auth-source-forget-all-cached) | 27 | ;; (auth-source-forget-all-cached) |
| 28 | ;; | 28 | ;; |
| 29 | ;; The kasi file path (e.g. "category/file") is matched against the | 29 | ;; The kasi file path (e.g. "category/file") is matched against the |
| 30 | ;; `:host' parameter. The `:user' parameter can optionally be used to | 30 | ;; `:host' parameter only if it contains a "/" (i.e. looks like a |
| 31 | ;; filter by the username stored in the kasi entry. | 31 | ;; directory path). Otherwise the `:host' is ignored and the search |
| 32 | ;; falls back to matching by `:user'. | ||
| 32 | 33 | ||
| 33 | ;;; Code: | 34 | ;;; Code: |
| 34 | 35 | ||
| @@ -78,7 +79,7 @@ optional filters." | |||
| 78 | (dolist (file files) | 79 | (dolist (file files) |
| 79 | (message "kasi-auth-source: checking %s" file) | 80 | (message "kasi-auth-source: checking %s" file) |
| 80 | (when-let* ((short-name (kasi--filename-short file)) | 81 | (when-let* ((short-name (kasi--filename-short file)) |
| 81 | ((or (not host) (string= short-name host))) | 82 | ((or (not host) (not (string-match-p "/" host)) (string= short-name host))) |
| 82 | (entry-user (kasi--get file 'username)) | 83 | (entry-user (kasi--get file 'username)) |
| 83 | (entry-email (kasi--get file 'email)) | 84 | (entry-email (kasi--get file 'email)) |
| 84 | ((or (not user) (string= entry-user user))) | 85 | ((or (not user) (string= entry-user user))) |
