mirror of https://github.com/borgbackup/borg.git
fix detection of non-local path, fixes #3108
filenames like ..foobar are valid, so, to detect stuff in upper dirs,
we need to include the path separator and check if it starts with '../'.
(cherry picked from commit 60e9249100
)
This commit is contained in:
parent
f407de07a8
commit
d35537c199
|
@ -557,7 +557,7 @@ Utilization of max. archive size: {csize_max:.0%}
|
||||||
|
|
||||||
original_path = original_path or item.path
|
original_path = original_path or item.path
|
||||||
dest = self.cwd
|
dest = self.cwd
|
||||||
if item.path.startswith(('/', '..')):
|
if item.path.startswith(('/', '../')):
|
||||||
raise Exception('Path should be relative and local')
|
raise Exception('Path should be relative and local')
|
||||||
path = os.path.join(dest, item.path)
|
path = os.path.join(dest, item.path)
|
||||||
# Attempt to remove existing files, ignore errors on failure
|
# Attempt to remove existing files, ignore errors on failure
|
||||||
|
|
Loading…
Reference in New Issue