Closed RKrahl closed 5 years ago
The culprit is the _is_normalized()
helper function in module archive.archive
:
def _is_normalized(p):
"""Check if the path is normalized.
"""
p = Path.cwd() / p
if p.resolve() == p:
return True
if p.is_symlink():
return p.resolve().parent == p.parent
else:
return False
The idea was to enforce that all paths should be below the base directory and exclude paths like base/../../../etc/passwd
. The condition for symlinks should be return p.parent.resolve() == p.parent
instead.
When trying to create an archive adding a symbolic link as a file argument,
archive-tool
throws an error "invalid path ...: must be normalized":