This patch fixes the server/replica installer crash caused by leaking ldap2 connection introduced by commit 620036d26e98fdcefff00168e9e5463a8257d49c during fixing https://fedorahosted.org/freeipa/ticket/5459

--
Martin^3 Babinsky
From eb3cf31f741c137371a30f567dac8471ab5a9c83 Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Tue, 24 Nov 2015 14:43:10 +0100
Subject: [PATCH] disconnect ldap2 backend after adding default CA ACL profiles

ensure_default_caacl() was leaking open api.Backend.ldap2 connection which
could crash server/replica installation at later stages. This patch ensures
that after checking default CA ACL profiles the backend is disconnected.

https://fedorahosted.org/freeipa/ticket/5459
---
 ipaserver/install/cainstance.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index 90edb362f496b89f433532bf8786c29da3902de9..cca27e9d2a4767e91771a918c12b2c852dc29161 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -2028,6 +2028,9 @@ def ensure_default_caacl():
         api.Command.caacl_add_profile(u'hosts_services_caIPAserviceCert',
             certprofile=(u'caIPAserviceCert',))
 
+    if api.Backend.ldap2.isconnected():
+        api.Backend.ldap2.disconnect()
+
 
 if __name__ == "__main__":
     standard_logging_setup("install.log")
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to