pgreco / rpms / ipa

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

Blame SOURCES/0011-replica-prepare-fix-wrong-IPA-CA-nickname-in-replica.patch

483b06
From c34fa1891b774e98de6a1787001f2215ea85c0f3 Mon Sep 17 00:00:00 2001
483b06
From: Jan Cholasta <jcholast@redhat.com>
483b06
Date: Fri, 17 Mar 2017 09:34:08 +0000
483b06
Subject: [PATCH] replica prepare: fix wrong IPA CA nickname in replica file
483b06
483b06
Lookup IPA CA subject and pass it to CertDB when creating dscert.p12 and
483b06
httpcert.p12, otherwise a generic nickname will be used for the IPA CA
483b06
certificate instead of "$REALM IPA CA".
483b06
483b06
This fixes replica install on domain level 0 from a replica file created
483b06
using ipa-replica-install on IPA 4.5.
483b06
483b06
https://pagure.io/freeipa/issue/6777
483b06
483b06
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
483b06
---
483b06
 ipaserver/install/ipa_replica_prepare.py | 7 ++++---
483b06
 1 file changed, 4 insertions(+), 3 deletions(-)
483b06
483b06
diff --git a/ipaserver/install/ipa_replica_prepare.py b/ipaserver/install/ipa_replica_prepare.py
483b06
index f4925a6c46b6714362545ee5e8194b7b02de5091..95c3818a9fc34c937f8b418e91a1bfc28352b02e 100644
483b06
--- a/ipaserver/install/ipa_replica_prepare.py
483b06
+++ b/ipaserver/install/ipa_replica_prepare.py
483b06
@@ -34,7 +34,7 @@ import dns.resolver
483b06
 from six.moves.configparser import SafeConfigParser
483b06
 # pylint: enable=import-error
483b06
 
483b06
-from ipaserver.install import certs, installutils, bindinstance, dsinstance
483b06
+from ipaserver.install import certs, installutils, bindinstance, dsinstance, ca
483b06
 from ipaserver.install.replication import enable_replication_version_checking
483b06
 from ipaserver.install.server.replicainstall import install_ca_cert
483b06
 from ipaserver.install.bindinstance import (
483b06
@@ -537,12 +537,13 @@ class ReplicaPrepare(admintool.AdminTool):
483b06
         """
483b06
         hostname = self.replica_fqdn
483b06
         subject_base = self.subject_base
483b06
+        ca_subject = ca.lookup_ca_subject(api, subject_base)
483b06
         nickname = "Server-Cert"
483b06
 
483b06
         try:
483b06
             db = certs.CertDB(
483b06
-                api.env.realm, nssdir=self.dir, subject_base=subject_base,
483b06
-                host_name=api.env.host)
483b06
+                api.env.realm, nssdir=self.dir, host_name=api.env.host,
483b06
+                subject_base=subject_base, ca_subject=ca_subject)
483b06
             db.create_passwd_file()
483b06
             db.create_from_cacert()
483b06
             db.create_server_cert(nickname, hostname)
483b06
-- 
483b06
2.12.1
483b06