mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
correctly set LDAP bind related attributes when setting up replication
when CA replica configures 'cn=replica,cn=o\=ipaca,cn=mapping tree,cn=config' entry on remote master during replica installation, the 'nsds5replicabinddn' and 'nsds5replicabinddngroup' attributes are not correctly updated when this entry already existed on the master (e.g. when existing domain-level 0 topology was promoted to domain level 1). This patch ensures that these attributes are always set correctly regardless of existence of the replica entry. https://fedorahosted.org/freeipa/ticket/5412 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
d726da3ba2
commit
f2b22ec017
@@ -435,13 +435,21 @@ class ReplicationManager(object):
|
||||
|
||||
try:
|
||||
entry = conn.get_entry(dn)
|
||||
managers = entry.get('nsDS5ReplicaBindDN')
|
||||
for m in managers:
|
||||
if replica_binddn == DN(m):
|
||||
return
|
||||
# Add the new replication manager
|
||||
mod = [(ldap.MOD_ADD, 'nsDS5ReplicaBindDN', replica_binddn)]
|
||||
conn.modify_s(dn, mod)
|
||||
managers = {DN(m) for m in entry.get('nsDS5ReplicaBindDN', [])}
|
||||
binddn_groups = {
|
||||
DN(p) for p in entry.get('nsds5replicabinddngroup', [])}
|
||||
|
||||
mod = []
|
||||
if replica_binddn not in managers:
|
||||
# Add the new replication manager
|
||||
mod.append((ldap.MOD_ADD, 'nsDS5ReplicaBindDN',
|
||||
replica_binddn))
|
||||
|
||||
if replica_groupdn not in binddn_groups:
|
||||
mod.append((ldap.MOD_ADD, 'nsds5replicabinddngroup',
|
||||
replica_groupdn))
|
||||
if mod:
|
||||
conn.modify_s(dn, mod)
|
||||
|
||||
# replication is already configured
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user