mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipa-kra-install must create directory if it does not exist
ipa-kra-install creates an admin cert file in /root/.dogtag/pki-tomcat/ca_admin.cert but does not check that the parent directory exists. This situation can happen when uninstall + restore has been run. The fix creates the directory if not present. https://fedorahosted.org/freeipa/ticket/6606 Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
parent
5de70e3199
commit
066f5b7c90
@ -259,6 +259,10 @@ class KRAInstance(DogtagInstance):
|
||||
else:
|
||||
# the admin cert file is needed for the first instance of KRA
|
||||
cert = DogtagInstance.get_admin_cert(self)
|
||||
# First make sure that the directory exists
|
||||
parentdir = os.path.dirname(paths.ADMIN_CERT_PATH)
|
||||
if not os.path.exists(parentdir):
|
||||
os.makedirs(parentdir)
|
||||
with open(paths.ADMIN_CERT_PATH, "w") as admin_path:
|
||||
admin_path.write(cert)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user