From aced3522dc28d68e411a273335a409b4e258f034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dipl=2E=20Ing=2E=20P=C3=A9ter=20Varkoly?= Date: Wed, 23 Jul 2025 11:36:21 +0200 Subject: [PATCH] Add missed for loop to set gdns --- radicale/auth/ldap.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/radicale/auth/ldap.py b/radicale/auth/ldap.py index 81ea518d..8cd07d37 100644 --- a/radicale/auth/ldap.py +++ b/radicale/auth/ldap.py @@ -180,6 +180,7 @@ class Auth(auth.BaseAuth): user_dn = user_entry[0] logger.debug(f"_login2 found LDAP user DN {user_dn}") if self._ldap_group_members_attr: + """Collect groups from the member or uniqueMember attributes""" res = conn.search_s( self._ldap_group_base, self.ldap.SCOPE_SUBTREE, @@ -189,6 +190,8 @@ class Auth(auth.BaseAuth): self.ldap.filter.escape_filter_chars(user_dn)), attrlist=self._ldap_attributes ) + for group in res: + gdns.append(group[0]) """Close LDAP connection""" conn.unbind() except Exception as e: @@ -277,6 +280,7 @@ class Auth(auth.BaseAuth): user_entry = conn.response[0] user_dn = user_entry['dn'] if self._ldap_group_members_attr: + """Collect groups from the member or uniqueMember attributes""" conn.search( search_base=self._ldap_group_base, search_filter="(&{0}({1}={2}))".format( @@ -302,10 +306,10 @@ class Auth(auth.BaseAuth): if not conn.bind(): logger.debug(f"_login3 user '{login}' cannot be found") return "" - tmp: list[str] = [] """Let's collect the groups of the user.""" if self._ldap_groups_attr: gdns = user_entry['attributes'][self._ldap_groups_attr] + tmp: list[str] = [] for g in gdns: """Get group g's RDN's attribute value""" try: