From 055ea253dfe0182671cba16916840a013daa8b74 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Thu, 19 Sep 2019 15:21:52 +0200 Subject: [PATCH] ipa-backup: backup the PKCS module config files setup by IPA ipa installer creates /etc/pkcs11/modules/softhsm2.module in order to disable global p11-kit configuration for NSS. This file was not included in the backups, and not restored. The fix adds the file to the list of files to include in a backup. Fixes: https://pagure.io/freeipa/issue/8073 Reviewed-By: Rob Crittenden --- ipaplatform/base/tasks.py | 5 +++++ ipaplatform/redhat/tasks.py | 7 +++++++ ipaserver/install/ipa_backup.py | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ipaplatform/base/tasks.py b/ipaplatform/base/tasks.py index 7fd7d5765..86617a07f 100644 --- a/ipaplatform/base/tasks.py +++ b/ipaplatform/base/tasks.py @@ -338,6 +338,11 @@ class BaseTaskNamespace: """ raise NotImplementedError + def get_pkcs11_modules(self): + """Return the list of module config files setup by IPA. + """ + return () + def configure_nsswitch_database(self, fstore, database, services, preserve=True, append=True, default_value=()): diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py index e18f6fad5..0afcb4796 100644 --- a/ipaplatform/redhat/tasks.py +++ b/ipaplatform/redhat/tasks.py @@ -744,6 +744,13 @@ class RedHatTaskNamespace(BaseTaskNamespace): return filenames + def get_pkcs11_modules(self): + """Return the list of module config files setup by IPA + """ + return tuple(os.path.join(paths.ETC_PKCS11_MODULES_DIR, + "{}.module".format(name)) + for name, _module, _disabled in PKCS11_MODULES) + def enable_ldap_automount(self, statestore): """ Point automount to ldap in nsswitch.conf. diff --git a/ipaserver/install/ipa_backup.py b/ipaserver/install/ipa_backup.py index 1ef10614f..6c08f19b6 100644 --- a/ipaserver/install/ipa_backup.py +++ b/ipaserver/install/ipa_backup.py @@ -194,7 +194,7 @@ class Backup(admintool.AdminTool): ) + tuple( os.path.join(paths.IPA_NSSDB_DIR, file) for file in (certdb.NSS_DBM_FILES + certdb.NSS_SQL_FILES) - ) + ) + tasks.get_pkcs11_modules() logs=( paths.VAR_LOG_PKI_DIR,