areguera / rpms / ipa

Forked from rpms/ipa 5 years ago
Clone

Blame SOURCES/0055-Fix-ipa-restore-create-var-run-ipa-files.patch

2737e7
From be17d3c929027a5ef9f5024aa1bb4112006bb6f6 Mon Sep 17 00:00:00 2001
2737e7
From: Florence Blanc-Renaud <flo@redhat.com>
2737e7
Date: Mon, 6 Aug 2018 16:57:48 +0200
2737e7
Subject: [PATCH] Fix ipa-restore: create /var/run/ipa files
2737e7
2737e7
In ipa 4.5.4, ipa-restore fails because the file /etc/tmpfiles.d/ipa.conf
2737e7
is not restored => /var/run/ipa and /var/run/ipa/ccaches directories
2737e7
are not created.
2737e7
2737e7
The fix creates these directories in ipa-restore and creates ipa.conf.
2737e7
With this approach, the fix allows to restore a backup done with 4.5.4
2737e7
prior to the fix.
2737e7
2737e7
Note: the fix is specific to ipa-4-5, in ipa-4-6 and above version the file
2737e7
/etc/tmpfiles.d/ipa.conf is created at package install time and not at
2737e7
ipa server install time.
2737e7
2737e7
Fixes: https://pagure.io/freeipa/issue/7571
2737e7
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2737e7
---
2737e7
 ipaserver/install/ipa_restore.py | 3 +++
2737e7
 1 file changed, 3 insertions(+)
2737e7
2737e7
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
2737e7
index a3824df230857b02b47c12645fadee1200afdf66..e069b8ba9b7a01e7602e66d4404063bbc2a1e795 100644
2737e7
--- a/ipaserver/install/ipa_restore.py
2737e7
+++ b/ipaserver/install/ipa_restore.py
2737e7
@@ -32,6 +32,7 @@ from six.moves.configparser import SafeConfigParser
2737e7
 from ipaclient.install.client import update_ipa_nssdb
2737e7
 from ipalib import api, errors
2737e7
 from ipalib.constants import FQDN
2737e7
+from ipalib.constants import IPAAPI_USER
2737e7
 from ipapython import version, ipautil
2737e7
 from ipapython.ipautil import run, user_input
2737e7
 from ipapython import admintool
2737e7
@@ -377,6 +378,8 @@ class Restore(admintool.AdminTool):
2737e7
             if restore_type == 'FULL':
2737e7
                 self.remove_old_files()
2737e7
                 self.cert_restore_prepare()
2737e7
+                tasks.create_tmpfiles_dirs(IPAAPI_USER)
2737e7
+                tasks.configure_tmpfiles()
2737e7
                 self.file_restore(options.no_logs)
2737e7
                 self.cert_restore()
2737e7
                 if 'CA' in self.backup_services:
2737e7
-- 
2737e7
2.17.1
2737e7