Cast file path to string.
Before passing a path into selinux.matchpathcon, it needs to be casted to a string, since the path could be unicode and selinux.matchpathcon does not support unicode. Closes-Bug: #1260072
This commit is contained in:
parent
cc04a21b7c
commit
f5814193a2
@ -170,6 +170,8 @@ class SeLinuxGuard(object):
|
||||
def __exit__(self, excp_type, excp_value, excp_traceback):
|
||||
if self.selinux and self.selinux.is_selinux_enabled():
|
||||
path = os.path.realpath(os.path.expanduser(self.path))
|
||||
# path should be a string, not unicode
|
||||
path = str(path)
|
||||
do_restore = False
|
||||
try:
|
||||
# See if even worth restoring??
|
||||
|
Loading…
x
Reference in New Issue
Block a user