pgreco / rpms / ipa

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

Blame SOURCES/0032-Changed-ownership-of-ldiffile-to-DS_USER.patch

c58629
From 780dc73f513cc312e87948b51e90ae885f29a8fb Mon Sep 17 00:00:00 2001
c58629
From: Thorsten Scherf <tscherf@redhat.com>
c58629
Date: Thu, 1 Jun 2017 22:02:57 +0200
c58629
Subject: [PATCH] Changed ownership of ldiffile to DS_USER
c58629
c58629
Resolves:
c58629
https://pagure.io/freeipa/issue/7010
c58629
c58629
Reviewed-By: Martin Basti <mbasti@redhat.com>
c58629
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
c58629
---
c58629
 ipaserver/install/ipa_restore.py | 4 ++++
c58629
 1 file changed, 4 insertions(+)
c58629
c58629
diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
c58629
index 923b1d6696d33c0bb07ca018b53dd3dabcc191aa..a3824df230857b02b47c12645fadee1200afdf66 100644
c58629
--- a/ipaserver/install/ipa_restore.py
c58629
+++ b/ipaserver/install/ipa_restore.py
c58629
@@ -540,6 +540,10 @@ class Restore(admintool.AdminTool):
c58629
                 ldif_parser = RemoveRUVParser(in_file, ldif_writer, self.log)
c58629
                 ldif_parser.parse()
c58629
 
c58629
+        # Make sure the modified ldiffile is owned by DS_USER
c58629
+        pent = pwd.getpwnam(constants.DS_USER)
c58629
+        os.chown(ldiffile, pent.pw_uid, pent.pw_gid)
c58629
+
c58629
         if online:
c58629
             conn = self.get_connection()
c58629
             ent = conn.make_entry(
c58629
-- 
c58629
2.13.6
c58629