pgreco / rpms / ipa

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

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

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