+ ;; find entries with port "ldap" that match the requested host if any
+ (asfound (when (plist-get search-plist 'auth-source)
+ (nth 0 (auth-source-search :host (or host t)
+ :create t))))
+ ;; if no host was requested, get it from the auth-source entry
+ (host (or host (plist-get asfound :host)))
+ ;; get the password from the auth-source
+ (passwd (or (plist-get search-plist 'passwd)
+ (plist-get asfound :secret)))
+ ;; convert the password from a function call if needed
+ (passwd (if (functionp passwd) (funcall passwd) passwd))
+ ;; get the binddn from the search-list or from the
+ ;; auth-source user or binddn tokens
+ (binddn (or (plist-get search-plist 'binddn)
+ (plist-get asfound :user)
+ (plist-get asfound :binddn)))
+ (base (or (plist-get search-plist 'base)
+ (plist-get asfound :base)
+ ldap-default-base))