pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0010-Fixing-replica-install-fix-ldap-connection-in-domlvl.patch

483b06
From 175c29c7b57a0ab48d1371c199e70f3435a0ead7 Mon Sep 17 00:00:00 2001
483b06
From: felipe <fbarreto@localhost.localdomain>
483b06
Date: Tue, 21 Mar 2017 09:05:56 -0300
483b06
Subject: [PATCH] Fixing replica install: fix ldap connection in domlvl 0
483b06
483b06
Now, at the domain level 0, the replica install always uses
483b06
Directory Manager credentials to create the LDAP connection.
483b06
Since ACIs permitting hosts to manage their own services were
483b06
added in 4.2 release,  the old master denies this operations.
483b06
483b06
https://pagure.io/freeipa/issue/6549
483b06
483b06
Reviewed-By: Martin Basti <mbasti@redhat.com>
483b06
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
483b06
---
483b06
 ipaserver/install/server/replicainstall.py | 11 ++++++++++-
483b06
 1 file changed, 10 insertions(+), 1 deletion(-)
483b06
483b06
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
483b06
index b4463fd4066efbc68f22e4f8f3175b59cb20b103..f489e691999fd9d6e82879341922510e56eac47d 100644
483b06
--- a/ipaserver/install/server/replicainstall.py
483b06
+++ b/ipaserver/install/server/replicainstall.py
483b06
@@ -1391,7 +1391,16 @@ def install(installer):
483b06
     dsinstance.create_ds_user()
483b06
 
483b06
     try:
483b06
-        conn.connect(ccache=ccache)
483b06
+        if promote:
483b06
+            conn.connect(ccache=ccache)
483b06
+        else:
483b06
+            # dmlvl 0 replica install should always use DM credentials
483b06
+            # to create remote LDAP connection. Since ACIs permitting hosts
483b06
+            # to manage their own services were added in 4.2 release,
483b06
+            # the master denies this operations.
483b06
+            conn.connect(bind_dn=ipaldap.DIRMAN_DN, cacert=cafile,
483b06
+                         bind_pw=config.dirman_password)
483b06
+
483b06
         # Update and istall updated CA file
483b06
         cafile = install_ca_cert(conn, api.env.basedn, api.env.realm, cafile)
483b06
 
483b06
-- 
483b06
2.12.1
483b06