From 0f69b2a713c094c248b7a4898d3f3a758b6f25aa Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Tue, 13 Feb 2018 11:59:01 +0100 Subject: [PATCH] get_attr : make case-insensitive on attribute name --- LdapServer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LdapServer.py b/LdapServer.py index 6f6b6f4..93102ae 100644 --- a/LdapServer.py +++ b/LdapServer.py @@ -106,6 +106,11 @@ class LdapServer(object): return obj[0][0] def get_attr(self,obj,attr,all=None,default=None): + if attr not in obj: + for k in obj: + if k.lower() == attr.lower(): + attr = k + break if all is not None: if attr in obj: return obj[attr]