Fabian Deutsch has posted comments on this change. Change subject: persist: fix owner/group copy to /config ......................................................................
Patch Set 1: Code-Review+2 (1 comment) https://gerrit.ovirt.org/#/c/39068/1/src/ovirt/node/utils/fs/__init__.py File src/ovirt/node/utils/fs/__init__.py: Line 484: except OSError as ose: Line 485: self._logger.error('Failed to clean up persisted file ' Line 486: '"%s": %s', abspath, ose.message) Line 487: self._prepare_dir(abspath, persisted_path) Line 488: abspath_stat = os.stat(abspath) This will solve the issue for wrong permissions for files, ut we also need to take care of: selinux and dirs and symlinks, so please: factor out a method which takes two paths, and is then taking care of ownership and selinux (copy both form src to dst) Line 489: owner = abspath_stat[stat.ST_UID] Line 490: group = abspath_stat[stat.ST_GID] Line 491: shutil.copy2(abspath, persisted_path) Line 492: os.chown(persisted_path, owner, group) -- To view, visit https://gerrit.ovirt.org/39068 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4ec3dc1773a0e84eb82c2682f9e145c15216dd91 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: master Gerrit-Owner: Douglas Schilling Landgraf <[email protected]> Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]> Gerrit-Reviewer: Fabian Deutsch <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
