1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix auth-source-pass to return nil if no entry found

* lisp/auth-source-pass.el (auth-source-pass-search): If there is no
matching entry, auth-source-pass-search should return nil, not (nil).
This lets auth-source fall back to other backends in the auth-sources
list.
* test/lisp/auth-source-pass-tests.el: Add corresponding test.

Copyright-paperwork-exempt: yes
This commit is contained in:
Magnus Henoch 2018-11-02 21:51:59 +00:00 committed by Damien Cassou
parent b9ac4f815e
commit 527efaf798
No known key found for this signature in database
GPG key ID: B68746238E59B548
2 changed files with 7 additions and 1 deletions

View file

@ -56,7 +56,8 @@ See `auth-source-search' for details on SPEC."
;; Do not build a result, as none will match when HOST is nil
nil)
(t
(list (auth-source-pass--build-result host port user)))))
(when-let ((result (auth-source-pass--build-result host port user)))
(list result)))))
(defun auth-source-pass--build-result (host port user)
"Build auth-source-pass entry matching HOST, PORT and USER."