ldap attributes filter in user_groups()

ldap search currently fetches ALL attributes which is a waste of bandwidth resources and
woefully slow on large ldap groups when it only needs to parse the name_attr

Signed-off-by: Jijo Varghese <jijojv@gmail.com>
This commit is contained in:
Jijo Varghese 2018-06-29 23:36:57 -07:00 committed by Bill Nottingham
parent b07e44ad69
commit e1dde21ec3

View File

@ -42,6 +42,7 @@ class PosixUIDGroupType(LDAPGroupType):
)
search = group_search.search_with_additional_term_string(filterstr)
search.attrlist = [self.name_attr]
groups = search.execute(ldap_user.connection)
except (KeyError, IndexError):
pass
@ -72,4 +73,3 @@ class PosixUIDGroupType(LDAPGroupType):
is_member = False
return is_member