diff options
author | Jan Cholasta <jcholast@redhat.com> | 2014-06-18 11:45:45 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2014-06-24 12:10:01 +0200 |
commit | 8b8774d138348ab4b938f98dc106ea983e261262 (patch) | |
tree | f21aaca41996ec2a7d18481d441439235178d411 /ipaserver/plugins/ldap2.py | |
parent | d6fb110b77e2c585f0bfc5eb11b0187a43263fa1 (diff) | |
download | freeipa-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/ldap2.py')
-rw-r--r-- | ipaserver/plugins/ldap2.py | 8 |
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): |