]> git.eshelyaron.com Git - emacs.git/commitdiff
Downcase field names in LDAP results
authorThomas Fitzsimmons <fitzsim@fitzsim.org>
Thu, 13 Nov 2014 06:30:53 +0000 (01:30 -0500)
committerThomas Fitzsimmons <fitzsim@fitzsim.org>
Thu, 13 Nov 2014 07:32:12 +0000 (02:32 -0500)
* net/eudcb-ldap.el (eudc-ldap-cleanup-record-simple): Downcase
field names of LDAP results.
(eudc-ldap-cleanup-record-filtering-addresses): Likewise.

lisp/ChangeLog
lisp/net/eudcb-ldap.el

index 10a2aa8e935fe31868642bdc3354b9d7da9797f1..30e584a0121347a1fdf7e3b1496c97891b66c683 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-13  Thomas Fitzsimmons  <fitzsim@fitzsim.org>
+
+       * 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  <fitzsim@fitzsim.org>
 
        * net/ldap.el (ldap-ldapsearch-password-prompt): New defcustom.
index 6c806d7b2218d97a2fda4102e0ccee6da6dfe913..1b01d21be8c874cc092c1ff5bd250075eddc9297 100644 (file)
   (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)))