emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 262f57842a: Allow auth-source-netrc-parse to return all lines


From: Lars Ingebrigtsen
Subject: master 262f57842a: Allow auth-source-netrc-parse to return all lines
Date: Thu, 4 Aug 2022 10:10:13 -0400 (EDT)

branch: master
commit 262f57842adabe7ec1447be93b2bc7f8bcdd53b9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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.
---
 lisp/auth-source.el | 46 ++++++++++++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 20 deletions(-)

diff --git a/lisp/auth-source.el b/lisp/auth-source.el
index a36386101a..55dbaab3ee 100644
--- a/lisp/auth-source.el
+++ b/lisp/auth-source.el
@@ -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-mtime (plist-get cached :mtime))
                (cached-secrets (plist-get cached :secret))
-               (check (lambda(alist)
+               (check (lambda (alist)
                         (and alist
-                             (auth-source-search-collection
-                              host
-                              (or
-                               (auth-source--aget alist "machine")
-                               (auth-source--aget alist "host")
-                               t))
-                             (auth-source-search-collection
-                              user
-                              (or
-                               (auth-source--aget alist "login")
-                               (auth-source--aget alist "account")
-                               (auth-source--aget alist "user")
-                               t))
-                             (auth-source-search-collection
-                              port
-                              (or
-                               (auth-source--aget alist "port")
-                               (auth-source--aget alist "protocol")
-                               t))
+                             (or
+                              (null host)
+                              (auth-source-search-collection
+                               host
+                               (or
+                                (auth-source--aget alist "machine")
+                                (auth-source--aget alist "host")
+                                t)))
+                             (or
+                              (null user)
+                              (auth-source-search-collection
+                               user
+                               (or
+                                (auth-source--aget alist "login")
+                                (auth-source--aget alist "account")
+                                (auth-source--aget alist "user")
+                                t)))
+                             (or
+                              (null port)
+                              (auth-source-search-collection
+                               port
+                               (or
+                                (auth-source--aget alist "port")
+                                (auth-source--aget alist "protocol")
+                                t)))
                              (or
                               ;; the required list of keys is nil, or
                               (null require)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]