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

Allow auth-source-netrc-parse to return all lines

* lisp/auth-source.el (auth-source-netrc-parse): If host/user/port
is nil, don't require those to match.
This commit is contained in:
Lars Ingebrigtsen 2022-08-04 16:09:48 +02:00
parent 0116c660c2
commit 262f57842a

View file

@ -925,27 +925,33 @@ Note that the MAX parameter is used so we can exit the parse early."
(cached (cdr-safe (assoc file auth-source-netrc-cache))) (cached (cdr-safe (assoc file auth-source-netrc-cache)))
(cached-mtime (plist-get cached :mtime)) (cached-mtime (plist-get cached :mtime))
(cached-secrets (plist-get cached :secret)) (cached-secrets (plist-get cached :secret))
(check (lambda(alist) (check (lambda (alist)
(and alist (and alist
(auth-source-search-collection (or
host (null host)
(or (auth-source-search-collection
(auth-source--aget alist "machine") host
(auth-source--aget alist "host") (or
t)) (auth-source--aget alist "machine")
(auth-source-search-collection (auth-source--aget alist "host")
user t)))
(or (or
(auth-source--aget alist "login") (null user)
(auth-source--aget alist "account") (auth-source-search-collection
(auth-source--aget alist "user") user
t)) (or
(auth-source-search-collection (auth-source--aget alist "login")
port (auth-source--aget alist "account")
(or (auth-source--aget alist "user")
(auth-source--aget alist "port") t)))
(auth-source--aget alist "protocol") (or
t)) (null port)
(auth-source-search-collection
port
(or
(auth-source--aget alist "port")
(auth-source--aget alist "protocol")
t)))
(or (or
;; the required list of keys is nil, or ;; the required list of keys is nil, or
(null require) (null require)