From 658983794ccfd56afeb376a2f2d7d9a382d25a0c Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Tue, 19 Feb 2019 09:25:24 +0100 Subject: [PATCH] pkinit setup: fix regression on master install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The commit 7785210 intended to fix ipa-pkinit-manage enable on a replica without any CA but introduced a regression: ipa-server-install fails to configure pkinit with the fix. This commit provides a proper fix without the regression: pkinit needs to contact Dogtag directly only in case there is no CA instance yet (for ex. because we are installing the first master). Fixes: https://pagure.io/freeipa/issue/7795 Reviewed-By: François Cami --- ipaserver/install/krbinstance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ipaserver/install/krbinstance.py b/ipaserver/install/krbinstance.py index 4ed94ddf7..247d1d136 100644 --- a/ipaserver/install/krbinstance.py +++ b/ipaserver/install/krbinstance.py @@ -429,13 +429,14 @@ class KrbInstance(service.Service): prev_helper = None # on the first CA-ful master without '--no-pkinit', we issue the # certificate by contacting Dogtag directly - localhost_has_ca = self.fqdn in find_providing_servers( + ca_instances = find_providing_servers( 'CA', conn=self.api.Backend.ldap2, api=self.api) + use_dogtag_submit = all( [self.master_fqdn is None, self.pkcs12_info is None, self.config_pkinit, - localhost_has_ca]) + len(ca_instances) == 0]) if use_dogtag_submit: ca_args = [