summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Slagle <james.slagle@gmail.com>2014-01-07 12:17:01 -0500
committerScott Moser <smoser@ubuntu.com>2014-01-07 12:17:01 -0500
commit3a4bf799ca2dd785fe1a5a35f188aed4f54ab5e5 (patch)
treedef96cefff6618a02c095028b9566eb84e38ac60
parent923a7d0efc3cf3224b891dc783321018d59ce33e (diff)
parent66ed882dc3cf24395386869ea3c1d54e8f22c38b (diff)
downloadvyos-cloud-init-3a4bf799ca2dd785fe1a5a35f188aed4f54ab5e5.tar.gz
vyos-cloud-init-3a4bf799ca2dd785fe1a5a35f188aed4f54ab5e5.zip
SeLinuxGuard: 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. LP: #1260072
-rw-r--r--ChangeLog2
-rw-r--r--cloudinit/util.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b7948f7..1286e7c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
datasource and cloud-init [Shraddha Pandhe]
- support running apt with 'eatmydata' via configuration token
apt_get_wrapper (LP: #1236531).
+ - convert paths provided in config-drive 'files' to string before writing
+ (LP: #1260072).
0.7.4:
- fix issue mounting 'ephemeral0' if ephemeral0 was an alias for a
partitioned block device with target filesystem on ephemeral0.1.
diff --git a/cloudinit/util.py b/cloudinit/util.py
index a8ddb390..a37172dc 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -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??