Skip to content

Commit

Permalink
Convert paths to string for tarinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Fasano committed Feb 15, 2024
1 parent a5c66e1 commit ddaa826
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unblob/handlers/archive/_safe_tarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def extract(self, tarinfo: tarfile.TarInfo, extract_root: Path): # noqa: C901
)

# The symlink will point to our relative target (may be updated below if unsafe)
tarinfo.linkname = rel_target
tarinfo.linkname = rel_target.as_posix()
logger.info(
"Link target is relative", linkname=tarinfo.linkname, name=tarinfo.name
)
Expand Down Expand Up @@ -160,7 +160,7 @@ def extract(self, tarinfo: tarfile.TarInfo, extract_root: Path): # noqa: C901
# Prepend placeholder directories before rel_target to get a valid path
# within extract_root. This is the relative version of resolved_path.
rel_target = Path("/".join(["placeholder"] * drop_count)) / rel_target
tarinfo.linkname = rel_target
tarinfo.linkname = rel_target.as_posix()

logger.debug("Creating symlink", points_to=resolved_path, name=tarinfo.name)

Expand Down

0 comments on commit ddaa826

Please sign in to comment.