From d1f3ff5506b5ff9bcdc4aa75174cc32f6e4269c6 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 26 Mar 2021 17:57:09 -0400 Subject: [PATCH] Call the LDAPClient layer when modifying values For add/remove member and remove_principal the LDAP connection was being used directly, bypassing the LDAPClient overlay. Related: https://pagure.io/freeipa/issue/8798 Signed-off-by: Rob Crittenden Reviewed-By: Rafael Guterres Jeffman --- ipaserver/plugins/ldap2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py index de48c4eab..8fb8ab496 100644 --- a/ipaserver/plugins/ldap2.py +++ b/ipaserver/plugins/ldap2.py @@ -425,7 +425,7 @@ class ldap2(CrudBackend, LDAPClient): with self.error_handler(): modlist = [(a, b, self.encode(c)) for a, b, c in modlist] - self.conn.modify_s(str(group_dn), modlist) + self.modify_s(str(group_dn), modlist) except errors.DuplicateEntry: # TYPE_OR_VALUE_EXISTS raise errors.AlreadyGroupMember() @@ -448,7 +448,7 @@ class ldap2(CrudBackend, LDAPClient): with self.error_handler(): modlist = [(a, b, self.encode(c)) for a, b, c in modlist] - self.conn.modify_s(str(group_dn), modlist) + self.modify_s(str(group_dn), modlist) except errors.MidairCollision: raise errors.NotGroupMember() @@ -502,7 +502,7 @@ class ldap2(CrudBackend, LDAPClient): (_ldap.MOD_REPLACE, 'krblastpwdchange', None)] with self.error_handler(): - self.conn.modify_s(str(dn), mod) + self.modify_s(str(dn), mod) # CrudBackend methods