summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2014-06-18 11:45:45 +0200
committerMartin Kosek <mkosek@redhat.com>2014-06-24 12:10:01 +0200
commit8b8774d138348ab4b938f98dc106ea983e261262 (patch)
treef21aaca41996ec2a7d18481d441439235178d411 /ipaserver/plugins
parentd6fb110b77e2c585f0bfc5eb11b0187a43263fa1 (diff)
downloadfreeipa-8b8774d138348ab4b938f98dc106ea983e261262.tar.gz
freeipa-8b8774d138348ab4b938f98dc106ea983e261262.tar.xz
freeipa-8b8774d138348ab4b938f98dc106ea983e261262.zip
Remove GetEffectiveRights control when ldap2.get_effective_rights fails.
Reviewed-By: Martin Kosek <mkosek@redhat.com>
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/ldap2.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py
index aa9a001c6..cfcec7c80 100644
--- a/ipaserver/plugins/ldap2.py
+++ b/ipaserver/plugins/ldap2.py
@@ -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):