From 91f3e79d81671441bbf7c187d1415d864f80d101 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 20 Dec 2010 10:05:17 -0500 Subject: 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 --- ipaserver/install/replication.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ipaserver') diff --git a/ipaserver/install/replication.py b/ipaserver/install/replication.py index 5474efdb..8d388a59 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 -- cgit