Skip to content

Commit 9bde224

Browse files
martonillesvlaci
authored andcommitted
fix(extractor): do not set permission on symlink
fix_permission is called before fix_symlink, hence the symlink might be an absolute target and setting an permission would fail, so we should ignore setting permission on symlink. Setting follow_symlinks=False on chmod() would be a solution, but not all platforms support it as of now. Ignoring permission setting on the target is ok, as that would be taken care separately.
1 parent 631c72e commit 9bde224

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

unblob/extractor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def carve_chunk_to_file(carve_path: Path, file: File, chunk: Chunk):
2323

2424

2525
def fix_permission(path: Path):
26+
if path.is_symlink():
27+
return
28+
2629
if path.is_file():
2730
path.chmod(0o644)
2831
elif path.is_dir():

0 commit comments

Comments
 (0)