URL: https://github.com/freeipa/freeipa/pull/1462
Author: flo-renaud
 Title: #1462: [Backport][ipa-4-5] Changed ownership of ldiffile to DS_USER
Action: opened

PR body:
"""
Resolves:
https://pagure.io/freeipa/issue/7010

Reviewed-By: Martin Basti <mba...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1462/head:pr1462
git checkout pr1462
From ef91b4ee03d59b748c1fed1d3b1292e79a0f9f83 Mon Sep 17 00:00:00 2001
From: Thorsten Scherf <tsch...@redhat.com>
Date: Thu, 1 Jun 2017 22:02:57 +0200
Subject: [PATCH] Changed ownership of ldiffile to DS_USER

Resolves:
https://pagure.io/freeipa/issue/7010

Reviewed-By: Martin Basti <mba...@redhat.com>
---
 ipaserver/install/ipa_restore.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
index 923b1d6696..a3824df230 100644
--- a/ipaserver/install/ipa_restore.py
+++ b/ipaserver/install/ipa_restore.py
@@ -540,6 +540,10 @@ def ldif2db(self, instance, backend, online=True):
                 ldif_parser = RemoveRUVParser(in_file, ldif_writer, self.log)
                 ldif_parser.parse()
 
+        # Make sure the modified ldiffile is owned by DS_USER
+        pent = pwd.getpwnam(constants.DS_USER)
+        os.chown(ldiffile, pent.pw_uid, pent.pw_gid)
+
         if online:
             conn = self.get_connection()
             ent = conn.make_entry(
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to