[node-patches] Change in ovirt-node[master]: security: Add encode to getfilecon and chcon

dougsland at redhat.com dougsland at redhat.com
Tue Aug 25 14:08:40 UTC 2015


Douglas Schilling Landgraf has posted comments on this change.

Change subject: security: Add encode to getfilecon and chcon
......................................................................


Patch Set 1:

Tested:

#1 - created a file in /tmp. touch /tmp/supertest
unconfined_u:object_r:user_tmp_t:s0 /tmp/supertest

#2 - Get context and set context

from ovirt.node.utils import security

context = security.Selinux().getcon(u'/etc/magic')
print(context)
security.Selinux().chcon(u'/tmp/supertest', context)

#3 - See the output of ls -Z 

# ls -Z /tmp/supertest
-rw-r--r--. root root unconfined_u:object_r:etc_t:s0   /tmp/z

-- 
To view, visit https://gerrit.ovirt.org/45301
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic7aa07db42eebfce8242f8bb36af9e628b13d11d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: No



More information about the node-patches mailing list