pgreco / rpms / ipa

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

Blame SOURCES/0016-ipa-restore-Restore-ownership-and-perms-on-389-ds-lo.patch

6ec482
From 24f33237eda1fddd82010b88fe1e8033a4c27976 Mon Sep 17 00:00:00 2001
6ec482
From: Rob Crittenden <rcritten@redhat.com>
6ec482
Date: Fri, 20 Sep 2019 15:36:36 -0400
6ec482
Subject: [PATCH] ipa-restore: Restore ownership and perms on 389-ds log
6ec482
 directory
6ec482
6ec482
Previously it would end up being owned by root:root mode 0755
6ec482
instead of dirsrv:dirsrv mode 0770.
6ec482
6ec482
https://pagure.io/freeipa/issue/7725
6ec482
6ec482
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
6ec482
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
6ec482
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
6ec482
---
6ec482
 ipaserver/install/ipa_restore.py | 6 +++++-
6ec482
 1 file changed, 5 insertions(+), 1 deletion(-)
6ec482
6ec482
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
6ec482
index 4941831585f473c4937b23b3f59d8ff99a654b0e..917f516c8fa414b23dcb451c9105c59e0afeec51 100644
6ec482
--- a/ipaserver/install/ipa_restore.py
6ec482
+++ b/ipaserver/install/ipa_restore.py
6ec482
@@ -592,11 +592,15 @@ class Restore(admintool.AdminTool):
6ec482
             logger.info("Waiting for LDIF to finish")
6ec482
             wait_for_task(conn, dn)
6ec482
         else:
6ec482
+            template_dir = paths.VAR_LOG_DIRSRV_INSTANCE_TEMPLATE % instance
6ec482
             try:
6ec482
-                os.makedirs(paths.VAR_LOG_DIRSRV_INSTANCE_TEMPLATE % instance)
6ec482
+                os.makedirs(template_dir)
6ec482
             except OSError as e:
6ec482
                 pass
6ec482
 
6ec482
+            os.chown(template_dir, pent.pw_uid, pent.pw_gid)
6ec482
+            os.chmod(template_dir, 0o770)
6ec482
+
6ec482
             args = [paths.LDIF2DB,
6ec482
                     '-Z', instance,
6ec482
                     '-i', ldiffile,
6ec482
-- 
6ec482
2.20.1
6ec482