runroot: Avoid squashing path components with os.path.join
Although this is often a surprising behaviour, the Python documentation
is quite clear on this:
If a component is an absolute path, all previous components are
thrown away and joining continues from the absolute path component.
https://docs.python.org/2/library/os.path.html#os.path.join
That means we need to ensure that we don't end up in this case.
This commit is contained in:
parent
f426fdb05d
commit
8097ffce7b
1 changed files with 1 additions and 0 deletions
|
|
@ -51,6 +51,7 @@ class RunRootTask(tasks.BaseTaskHandler):
|
|||
else:
|
||||
options.append(o)
|
||||
rel_path = path[len(mount_data['mountpoint']):]
|
||||
rel_path = rel_path[1:] if rel_path.startswith('/') else rel_path
|
||||
res = (os.path.join(mount_data['path'], rel_path), path, mount_data['fstype'], ','.join(options))
|
||||
return res
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue