Remove GetEffectiveRights control when ldap2.get_effective_rights fails.

Reviewed-By: Martin Kosek <mkosek@redhat.com>
This commit is contained in:
Jan Cholasta 2014-06-18 11:45:45 +02:00 committed by Martin Kosek
parent d6fb110b77
commit 8b8774d138

View File

@ -333,9 +333,11 @@ class ldap2(LDAPClient, CrudBackend):
"krbPrincipalAux", base_dn=api.env.basedn)
sctrl = [GetEffectiveRightsControl(True, "dn: " + str(entry.dn))]
self.conn.set_option(_ldap.OPT_SERVER_CONTROLS, sctrl)
entry = self.get_entry(dn, attrs_list)
# remove the control so subsequent operations don't include GER
self.conn.set_option(_ldap.OPT_SERVER_CONTROLS, [])
try:
entry = self.get_entry(dn, attrs_list)
finally:
# remove the control so subsequent operations don't include GER
self.conn.set_option(_ldap.OPT_SERVER_CONTROLS, [])
return entry
def can_write(self, dn, attr):