Skip to content

Read an HFS+ catalog and attributes file that continue in the extents overflow tree - #176

Merged
switch-nz merged 2 commits into
mainfrom
claude/hfsplus-fragmented-catalog
Oct 1, 2026
Merged

switch-nz merged 2 commits into
mainfrom
claude/hfsplus-fragmented-catalog

Conversation

@switch-nz

Copy link
Copy Markdown
Owner

What changes for examiners

An HFS+ volume could list as empty while other tools showed its folders. The volume header holds only the first eight extents of each system file. A catalog (or attributes file) in more pieces than that continues in the extents overflow file, which Strata did not consult for those two files. A catalog B-tree's first leaf can be any node in the file, so when it lay beyond the first eight pieces its node read as nothing and the walk ended at once: "Empty directory.", no volume name, no extended attributes, and no message saying why.

Both files are now read in full: their forks are completed from the overflow tree when the header's extents do not account for all their blocks. Ordinary files already did this.

Verification

  • tests/imagebuild_hfsplus.py can now scatter the catalog and attributes files a block at a time (so most extents are in the overflow tree) and number the catalog's leaves from the top down. libfshfs, an independent reader, lists that volume correctly (root folder and its 250 entries), so the builder matches the real layout.
  • On the old reader that volume reproduces the symptom exactly: root listing [], volume name None. tests/test_hfsplus_fragmented.py (7 tests) fails on the old code (3 failures, 2 errors) and passes now: listing, file read, extended attributes in a scattered attributes file, volume name, a contiguous volume unchanged, and missing overflow records giving a partial listing rather than an error.
  • Full suite 1336 tests OK (14 skipped), smoke passes.
  • Not yet checked against a large volume written by macOS. The diagnosis fits a large, aged volume whose catalog is fragmented, but I could only infer it from the symptom.

🤖 Generated with Claude Code

https://claude.ai/code/session_017DPjyZZHvaivtvJ3N4hZhz


Generated by Claude Code

claude and others added 2 commits October 1, 2026 10:34
… overflow tree

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017DPjyZZHvaivtvJ3N4hZhz
@switch-nz
switch-nz merged commit 9d663e9 into main Oct 1, 2026
32 checks passed
@switch-nz
switch-nz deleted the claude/hfsplus-fragmented-catalog branch October 1, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants