pgreco / rpms / ipa

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

Blame SOURCES/0064-httpinstance-make-sure-NSS-database-is-backed-up.patch

483b06
From 27360b29b510d5ae92469b079569973676efd26c Mon Sep 17 00:00:00 2001
483b06
From: Jan Cholasta <jcholast@redhat.com>
483b06
Date: Mon, 3 Apr 2017 10:49:26 +0000
483b06
Subject: [PATCH] httpinstance: make sure NSS database is backed up
483b06
483b06
The NSS database at /etc/httpd/alias is not properly initialized and backed
483b06
up in CA-less replica promotion. This might cause the install to fail after
483b06
previous install and uninstall.
483b06
483b06
Make sure the NSS database is initialized and backed up even in CA-less
483b06
replica promotion to fix the issue.
483b06
483b06
https://pagure.io/freeipa/issue/4639
483b06
483b06
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
483b06
---
483b06
 ipaserver/install/httpinstance.py | 3 ++-
483b06
 1 file changed, 2 insertions(+), 1 deletion(-)
483b06
483b06
diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py
483b06
index 3e4252cb1e907618d4aa15f7381caff5e4e868e3..079ea92606cc53f98beca1759a7e24db64bfd3f4 100644
483b06
--- a/ipaserver/install/httpinstance.py
483b06
+++ b/ipaserver/install/httpinstance.py
483b06
@@ -375,10 +375,11 @@ class HTTPInstance(service.Service):
483b06
         return False
483b06
 
483b06
     def __setup_ssl(self):
483b06
+        truncate = not self.promote or not self.ca_is_configured
483b06
         db = certs.CertDB(self.realm, nssdir=paths.HTTPD_ALIAS_DIR,
483b06
                           subject_base=self.subject_base, user="root",
483b06
                           group=constants.HTTPD_GROUP,
483b06
-                          truncate=(not self.promote))
483b06
+                          truncate=truncate)
483b06
         self.disable_system_trust()
483b06
         if self.pkcs12_info:
483b06
             if self.ca_is_configured:
483b06
-- 
483b06
2.12.2
483b06