Skip to content

Commit dfdf3e3

Browse files
Andrew Fasanoqkaiser
Andrew Fasano
authored andcommitted
Bugfix: for absolute links in tarfile extraction
Explicitly use extract_root in output path instead of ./ to avoid issues with symlinks within directories.
1 parent e734195 commit dfdf3e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

unblob/handlers/archive/_safe_tarfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def extract(self, tarinfo: tarfile.TarInfo, extract_root: Path): # noqa: C901
8282
"Absolute path as link target.",
8383
"Converted to extraction relative path.",
8484
)
85-
tarinfo.linkname = f"./{tarinfo.linkname}"
85+
tarinfo.linkname = f"{extract_root}/{tarinfo.linkname}"
8686

8787
if not is_safe_path(
8888
basedir=extract_root,

0 commit comments

Comments
 (0)