403b09
From d5723c202f45edc17c45a7f2a1970eebed259dd5 Mon Sep 17 00:00:00 2001
403b09
From: Jan Cholasta <jcholast@redhat.com>
403b09
Date: Thu, 1 Sep 2016 10:32:18 +0200
403b09
Subject: [PATCH] custodia: force reconnect before retrieving CA certs from
403b09
 LDAP
403b09
403b09
Force reconnect to LDAP as DS might have been restarted after the
403b09
connection was opened, rendering the connection invalid.
403b09
403b09
This fixes a crash in ipa-replica-install with --setup-ca.
403b09
403b09
https://fedorahosted.org/freeipa/ticket/6207
403b09
403b09
Reviewed-By: Martin Basti <mbasti@redhat.com>
403b09
---
403b09
 ipaserver/install/custodiainstance.py | 2 ++
403b09
 1 file changed, 2 insertions(+)
403b09
403b09
diff --git a/ipaserver/install/custodiainstance.py b/ipaserver/install/custodiainstance.py
403b09
index 18bd51426cde09af6a34855a49db386a72cc6b9c..32740274ceae17eebeeb32ef5e043cf4b738ee0d 100644
403b09
--- a/ipaserver/install/custodiainstance.py
403b09
+++ b/ipaserver/install/custodiainstance.py
403b09
@@ -158,6 +158,8 @@ class CustodiaInstance(SimpleServiceInstance):
403b09
             # Add CA certificates
403b09
             tmpdb = CertDB(self.realm, nssdir=tmpnssdir)
403b09
             self.suffix = ipautil.realm_to_suffix(self.realm)
403b09
+            if self.admin_conn is not None:
403b09
+                self.ldap_disconnect()
403b09
             self.import_ca_certs(tmpdb, True)
403b09
 
403b09
             # Now that we gathered all certs, re-export
403b09
-- 
403b09
2.7.4
403b09