diff options
author | Simo Sorce <ssorce@redhat.com> | 2010-12-20 10:05:17 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2010-12-21 17:28:13 -0500 |
commit | 91f3e79d81671441bbf7c187d1415d864f80d101 (patch) | |
tree | f6a98d08b07cd7bccefbb2e4dfdc9a961d33a0c5 /ipaserver/install/replication.py | |
parent | efd8b03ccfc5ba25c383eacafa948aa0aa5feddf (diff) | |
download | freeipa-91f3e79d81671441bbf7c187d1415d864f80d101.tar.gz freeipa-91f3e79d81671441bbf7c187d1415d864f80d101.tar.xz freeipa-91f3e79d81671441bbf7c187d1415d864f80d101.zip |
Remove referrals when removing agreements
Part of this fix requires also giving proper permission to change the
replication agreements root.
While there also fix replica-related permissions to have the classic
add/modify/remove triplet of permissions.
Fixes: https://fedorahosted.org/freeipa/ticket/630
Diffstat (limited to 'ipaserver/install/replication.py')
-rw-r--r-- | ipaserver/install/replication.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py index 5474efdb8..8d388a597 100644 --- a/ipaserver/install/replication.py +++ b/ipaserver/install/replication.py @@ -407,6 +407,19 @@ class ReplicationManager: cn, dn = self.agreement_dn(hostname) return self.conn.deleteEntry(dn) + def delete_referral(self, hostname): + esc1_suffix = self.suffix.replace('=', '\\3D').replace(',', '\\2C') + esc2_suffix = self.suffix.replace('=', '%3D').replace(',', '%2C') + dn = 'cn=%s,cn=mapping tree,cn=config' % esc1_suffix + # TODO: should we detect proto/port somehow ? + mod = [(ldap.MOD_DELETE, 'nsslapd-referral', + 'ldap://%s:389/%s' % (hostname, esc2_suffix))] + + try: + self.conn.modify_s(dn, mod) + except Exception, e: + logging.debug("Failed to remove referral value: %s" % str(e)) + def check_repl_init(self, conn, agmtdn): done = False hasError = 0 |