Repository navigation
fix(iso9660): read Joliet trees whose .. records name their own directory - #14817
Conversation
…tory libisofs, behind xorriso and its mkisofs emulation, writes every Joliet subdirectory's .. record with that directory's own extent and length: write_one_dir_record() reads the block and length before it switches to the parent node. The reader required .. to name the parent and refused the whole image, so a Joliet ISO from xorriso -J, such as the Alpine 3.21 release ISOs, could be neither inspected nor extracted. A Joliet tree now also accepts a .. record that describes the directory itself. The primary tree keeps the strict check.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge, with the previous test coverage gap addressed. SummaryThe PR accepts Joliet
Reviews (4) · Last reviewed commit: "test(iso9660): check a self-describing J..." · Reviewed by Greptile |
The reader test gives every directory the same data length and no extended attribute record, so it would still pass if the relaxed check compared those fields with the parent's. The parent link here differs in both, and a self-describing .. carrying the parent's data length or extended attribute length is rejected.
…pgp-633-20261127 * commit '3097263763611eb0c32c502d5a222060cf02f468': fix(cli): describe universal Mach-O slice selection without a single-dash flag (#14912) fix(iso9660): read Joliet trees whose .. records name their own directory (#14817) feat(gpu)!: add per-call object, work, report, metadata, structure, and parser budgets to inspect_gpu_code_objects (#14882) fix(macho)!: select arm64e.x1 slices of universal Mach-O files by exact subtype (#14881) refactor(views): share bounded parent and report limitations (#14902) refactor(desktop): share XML parent pointers in task drafts (#14905) feat(ghidra): define function-pointer members and typedefs (#14889) refactor(setup): share publication destination checks (#14904) perf(ci): skip unused test runtime uploads (#14903) fix(nuget): preserve explicitly spaced publisher metadata (#14906) fix(artifacts): keep uImage coverage unknown when bytes follow the declared payload (#14896) fix(artifacts): report incomplete Android sparse coverage (#14883) fix(tar): require both end-of-archive blocks for complete coverage (#14884) refactor(views): centralize indexed row paging (#14878) refactor(views): reuse optional filters in report projections (#14877)
Summary
inspect-artifactandextract-artifactrefuse every Joliet ISO written by libisofs, which is whatxorriso -Jand xorriso's mkisofs emulation produce. I hit it on the Alpine 3.21 release ISO (alpine-virt-3.21.3-x86_64.iso): the whole image is reported as malformed, so neither tree is listed and nothing can be extracted. No issue is linked; this PR carries the reproduction.Problem and expected behavior
In a libisofs Joliet tree, each subdirectory's
..record carries the directory's own extent and length instead of its parent's. The cause is in libisofswrite_one_dir_record()(libisofs/joliet.c, unchanged in 1.5.8): it readsblockandlenfrom the node, and only afterwards doesif (file_id == 1 && node->parent) node = node->parent;, so only the timestamp and flags come from the parent. The primary tree written by the same library is correct.assertMandatoryLinkrequires..to match the parent's record, so the first Joliet subdirectory fails:Expected: the image is read like the same tree without Joliet, since the
..value is never used to find a directory (children are reached from their parent's records, and cycles are caught by the visited-extent set).Change and scope
Iso9660DirectoryLinksgets an optionalparentMayBeSelf. When it is set and the..record's extent is the directory's own, the record is checked against the directory's own link (extent, data length, extended attribute length) instead of the parent's. The reader sets it only for the Joliet tree. The primary tree keeps the strict check, including the existing case iniso9660Structures.test.tswhere a subdirectory's..names itself. The ISO 9660 guide states the exception.Not included: falling back to the primary tree when the Joliet tree is damaged in other ways.
Contract and boundary impact
parseIso9660DirectoryExtentinsrc/domain/iso9660/iso9660Structures.ts;Iso9660ArtifactReaderpasses the tree kind.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
Iso9660ArtifactReader.test.tsbuilds the Joliet fixture, rewrites each Joliet subdirectory's..with its own extent and length as libisofs does, and checks that the tree and file bytes are read; the same rewrite in a primary-only image is still rejected as malformed.the parent (..) record references block 23, not the parent directory's extent at block 22. Through the compiled CLI,extract-artifactexits 1 with the error above on the Alpine 3.21.3 virt ISO and on two images I made withxorriso -as mkisofs -J(with and without-R). Images from the same tree without-Jread fine on the base.extract-artifactexits 0 on all three: 119 files from the Alpine ISO, 306 from each xorriso image. For the-J -joliet-longimage every extracted file has the same MD5 as the source tree...that names neither its parent nor itself.For evidence-bearing changes:
Validation performed
npx vitest run src/artifacts/Iso9660ArtifactReader.test.ts src/artifacts/Iso9660ArtifactReader.boundaries.test.ts src/domain/iso9660/iso9660Structures.test.ts: base 1 failed / 102 passed; fix 103 passed.npm run compile, thennode scripts/rea.mjs extract-artifact <iso> --output-root <dir> --jsonon the three ISOs: base exit 1 (malformed), fix exit 0 as above.node scripts/run-typescript.mjs --noEmit: exit 0.npx oxfmt --checkon the changed files: clean.npx oxlinton them: 0 errors.Compatibility, safety, and release
..names the directory itself, which cannot introduce a new directory to walk; cycle and extent bounds checks are unchanged.Author readiness
Human owner:
Author checklist (completed by the PR author before requesting review)
type(scope): outcome.REA_runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.Found by a defect-hunting pipeline I build and run (Dev-next-gen), using Claude Code with Anthropic's Claude Opus 5.5.