mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:10:53 +01:00
[PR #1658] fssm_unpack: validate DXBC magic and 24-byte XBCH header, guard empty --carve-index and write OSErrors, and preserve index symlinks/mode #1672
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1672
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1658
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/fssm-unpack-io-and-bounds📝 Commits (1)
9231063fssm_unpack: validate DXBC magic and 24-byte XBCH header, guard empty --carve-index and write errors, and preserve index symlinks/mode📊 Changes
2 files changed (+125 additions, -17 deletions)
View changed files
📝
tests/test_fssm_unpack.py(+78 -0)📝
tools/fssm_unpack.py(+47 -17)📄 Description
Item ID:
FSSM-UNPACK-IO-AND-BOUNDSClaim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7155785517
Summary
tools/fssm_unpack.py): validateb"DXBC"magic inparts()(previously any 32-byte blob with zeroed part count succeeded silently) and require the full 24-byte XBCH header in_inflate_xbch()(catching 20..23-byte truncated headers withstruct.error)._unpack_with_count()betweenunpack()andmain()somain()no longer re-parses DXBC/XDAT twice per container.--carve-index(previously falsy""silently fell back to scanning the directory); fail upfront with exit2whenfssm_index.jsonis a directory; catchOSErrorcleanly (exit2, no traceback) when writing.fssmblobs or publishingfssm_index.json.fssm_index.jsontargets so the symlink is preserved, preserve target file mode viafile_mode.published_mode(), and append a trailing newline.tests/test_fssm_unpack.py): add 4 regression tests covering DXBC magic, 20/23-byte truncated XBCH headers, empty--carve-index, directory/writeOSErrorpaths, and symlink/mode preservation.Verification
python3 -W error -I tests/test_fssm_unpack.py -v: 52 passed, 0 failed (1.022s).python3 -I tests/test_replace_retry.py: 10 tests OK (2 skipped).python3 -I tests/test_shader_stage_manifest.py: 17 tests OK.python3 -I tests/test_fssm_crosscheck.py: 6 tests OK.main: ran=52, failures=5, errors=0.python3 -m compileall -q tools/fssm_unpack.py tests/test_fssm_unpack.py,python3 -I tests/test_text_write_line_endings.py,python3 -I scripts/check_no_game_data.py: all pass.AI-assisted: yes
GPUs tested: none (CPU unit tests with synthetic DXBC/XBCH/FSSM bytes; no game data)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.