1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 01:06:50 +00:00

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 '../'.
This commit is contained in:
Thomas Waldmann 2017-10-10 01:36:44 +02:00
parent b853ad8f85
commit 60e9249100

View file

@ -557,7 +557,7 @@ def extract_item(self, item, restore_attrs=True, dry_run=False, stdout=False, sp
original_path = original_path or item.path
dest = self.cwd
if item.path.startswith(('/', '..')):
if item.path.startswith(('/', '../')):
raise Exception('Path should be relative and local')
path = os.path.join(dest, item.path)
# Attempt to remove existing files, ignore errors on failure