fix(web): recognize AppleDouble ZIP metadata #6100
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6100"
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?
Imported from boykopovar/AnyPS5. Originally posted by Zinebyte on 2026-10-14T22:08:23Z.
What
A ZIP with
Title/main.elfandTitle/sce_module/provider.prxworks, but adding the__MACOSX/Title/._main.elfsidecar produced by macOS archive tools prevents the commonTitle/directory from being stripped. The browser then rejects the same application with “found 0” executable ELFs.Recognize the parallel AppleDouble metadata tree only when its files have valid version-2 headers and bounded descriptors, and every sidecar corresponds to an application file or directory. Exclude that recognized tree from root selection and conversion input. Malformed metadata and unrelated entries remain selected, and all original ZIP entries still undergo path, duplicate, encryption, special-file and memory-budget validation.
Add real ZIP regressions to the existing web test job using its already-pinned zip.js dependency. The test additions compose cleanly with #6780 and #6190: the AppleDouble cases precede the existing root-selection cases, and the archive-root regression runs as a separate workflow step before the existing syntax and helper checks. The composed archive-root, batch and output-directory suites pass. Production code and all test assertions are unchanged by this layout adjustment. Apple documents this parallel
__MACOSXlayout in https://developer.apple.com/forums/thread/690457; the header and descriptor format is specified in https://www.rfc-editor.org/rfc/rfc1740.html#appendix-B.Tested
Linux, Node.js 22.23.2: the complete archive-root suite and output-directory suite pass. The archive-root suite fails against unchanged main on the metadata-wrapped ZIP. Valid metadata ZIPs retain the original executable and module bytes for Linux and Windows conversion inputs; malformed headers/descriptors, orphan sidecars and unrelated files remain selected. Unsafe paths, duplicates, encrypted entries and special files still fail before filtering. Full ELF/module fixture inputs also remain byte-identical.
Rebased onto main
4524944396. The workflow-equivalent archive-root, module syntax and output-directory checks pass locally. Independent scratch merges with #67806737423d02and #619009afe38730are clean, and both combined archive-root regressions plus the batch/output-directory suites pass. Hosted Web tests passed on exact updated head3a0b032c59, executing the archive-root regressions and output-directory suite. Conventions and eligibility passed. Local conventions and whitespace checks pass. Independent adversarial review checked malformed payload bounds, short reads and application-only companions. No retail-title or native macOS execution claim.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T22:51:00Z.
Checked the AppleDouble recognition against the diff:
archive-root.test.mjspasses on this head and fails with main'sarchive.mjs("found 0"). The negative rows (bad magic/version, truncated or oversized descriptor table, overlapping/out-of-range descriptors, orphan sidecars, unrelated__MACOSXentries) stay selected, and the unsafe-path/duplicate/encrypted/special-file checks still run before filtering.output-directorysuite passes and Web tests are green on the head; merging.