Skip to content

Conversation

@qkaiser
Copy link
Contributor

@qkaiser qkaiser commented Dec 9, 2025

A fix was required due to PermissionError being raised on a CPIO archive:

2025-12-09 14:18.12 [error    ] Unknown error happened while extracting chunk pid=254493
Traceback (most recent call last):
  File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/tmp/out/bad_cpio.bin_extract/opt/redacted'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/quentin/.local/lib/python3.10/site-packages/unblob/processing.py", line 630, in _extract_chunk
    if result := chunk.extract(carved_path, extract_dir):
  File "/home/quentin/.local/lib/python3.10/site-packages/unblob/models.py", line 120, in extract
    return self.handler.extract(inpath, outdir)
  File "/home/quentin/.local/lib/python3.10/site-packages/unblob/models.py", line 472, in extract
    return self.EXTRACTOR.extract(inpath, outdir)
  File "/home/quentin/.local/lib/python3.10/site-packages/unblob/handlers/archive/cpio.py", line 387, in extract
    parser.dump_entries(fs)
  File "/home/quentin/.local/lib/python3.10/site-packages/unblob/handlers/archive/cpio.py", line 220, in dump_entries
    fs.mkdir(
  File "/home/quentin/.local/lib/python3.10/site-packages/unblob/file_utils.py", line 522, in mkdir
    safe_path.mkdir(mode=mode, parents=parents, exist_ok=exist_ok)
  File "/usr/lib/python3.10/pathlib.py", line 1184, in mkdir
    if not exist_ok or not self.is_dir():
  File "/usr/lib/python3.10/pathlib.py", line 1305, in is_dir
    return S_ISDIR(self.stat().st_mode)
  File "/usr/lib/python3.10/pathlib.py", line 1097, in stat
    return self._accessor.stat(self, follow_symlinks=follow_symlinks)
PermissionError: [Errno 13] Permission denied: '/tmp/out/bad_cpio.bin_extract/opt/redacted'

@qkaiser qkaiser self-assigned this Dec 9, 2025
@qkaiser qkaiser added bug Something isn't working python Pull requests that update Python code labels Dec 9, 2025
@qkaiser qkaiser force-pushed the fix-cpio-permission branch from 5bb4190 to dff6421 Compare December 9, 2025 15:05
@qkaiser qkaiser added this pull request to the merge queue Dec 11, 2025
Merged via the queue into main with commit 7a65bd9 Dec 11, 2025
22 checks passed
@qkaiser qkaiser deleted the fix-cpio-permission branch December 11, 2025 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants