>From aba4ff14624d7c99c76b18fa065aa0ae458f621b Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Thu, 13 Nov 2014 01:30:53 -0500 Subject: [PATCH 09/16] Downcase field names in LDAP results * net/eudcb-ldap.el (eudc-ldap-cleanup-record-simple): Downcase field names of LDAP results. (eudc-ldap-cleanup-record-filtering-addresses): Likewise. --- lisp/ChangeLog | 6 ++++++ lisp/net/eudcb-ldap.el | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 43760f2..3d41760 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2014-11-13 Thomas Fitzsimmons + * net/eudcb-ldap.el (eudc-ldap-cleanup-record-simple): Downcase + field names of LDAP results. + (eudc-ldap-cleanup-record-filtering-addresses): Likewise. + +2014-11-13 Thomas Fitzsimmons + * net/ldap.el (ldap-ldapsearch-password-prompt): New defcustom. (ldap-search-internal): Send password to ldapsearch through a pipe instead of via the command line. diff --git a/lisp/net/eudcb-ldap.el b/lisp/net/eudcb-ldap.el index 6c806d7..1b01d21 100644 --- a/lisp/net/eudcb-ldap.el +++ b/lisp/net/eudcb-ldap.el @@ -79,7 +79,11 @@ (mapcar (function (lambda (field) - (cons (intern (car field)) + ;; Some servers return case-sensitive names (e.g. givenName + ;; instead of givenname); downcase the field's name so that it + ;; can be matched against + ;; eudc-ldap-attributes-translation-alist. + (cons (intern (downcase (car field))) (if (cdr (cdr field)) (cdr field) (car (cdr field)))))) @@ -95,7 +99,7 @@ (mapcar (function (lambda (field) - (let ((name (intern (car field))) + (let ((name (intern (downcase (car field)))) (value (cdr field))) (if (memq name '(postaladdress registeredaddress)) (setq value (mapcar 'eudc-filter-$ value))) -- 1.8.1.4