From 0dee07009485caa7b39a762741e5cab3648afe6f Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Thu, 13 Nov 2014 00:59:12 -0500 Subject: [PATCH] Support new-style LDAP URIs in ldap-search-internal * net/ldap.el (ldap-search-internal): Support new-style LDAP URIs. --- lisp/ChangeLog | 4 ++++ lisp/net/ldap.el | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3a68f33044d..831e3b03a76 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-11-13 Thomas Fitzsimmons + + * net/ldap.el (ldap-search-internal): Support new-style LDAP URIs. + 2014-11-13 Thomas Fitzsimmons * net/eudc-vars.el (eudc-server): Adjust docstring to mention diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 10ce7a78d35..2b5b2fb89a5 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -559,7 +559,13 @@ an alist of attribute/value pairs." (erase-buffer) (if (and host (not (equal "" host))) - (setq arglist (nconc arglist (list (format "-h%s" host))))) + (setq arglist (nconc arglist + (list (format + ;; Use -H if host is a new-style LDAP URI. + (if (string-match "^[a-zA-Z]+://" host) + "-H%s" + "-h%s") + host))))) (if (and attrsonly (not (equal "" attrsonly))) (setq arglist (nconc arglist (list "-A")))) -- 2.39.5