Douglas Schilling Landgraf has uploaded a new change for review. Change subject: security: Add encode to getfilecon and chcon ......................................................................
security: Add encode to getfilecon and chcon Make sure both calls are utf8 encoded. Change-Id: Ic7aa07db42eebfce8242f8bb36af9e628b13d11d Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1252268 Signed-off-by: Douglas Schilling Landgraf <[email protected]> --- M src/ovirt/node/utils/security.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/12/45312/1 diff --git a/src/ovirt/node/utils/security.py b/src/ovirt/node/utils/security.py index 1556433..130f49c 100644 --- a/src/ovirt/node/utils/security.py +++ b/src/ovirt/node/utils/security.py @@ -109,14 +109,14 @@ def getcon(self, abspath): """ Return context of file, symlink or dir """ try: - return selinux.getfilecon(abspath)[1] + return selinux.getfilecon(abspath.encode("utf-8"))[1] except OSError: self._logger.warning('Cannot get selinux context: "%s"', abspath) def chcon(self, abspath, context): """ Change selinux security context """ try: - return selinux.chcon(abspath, context) + return selinux.chcon(abspath.encode("utf-8"), context) except OSError: self._logger.warning('Cannot change selinux context: "%s" "%s"', (abspath, context)) -- To view, visit https://gerrit.ovirt.org/45312 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7aa07db42eebfce8242f8bb36af9e628b13d11d Gerrit-PatchSet: 1 Gerrit-Project: ovirt-node Gerrit-Branch: ovirt-3.5 Gerrit-Owner: Douglas Schilling Landgraf <[email protected]> _______________________________________________ node-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/node-patches
