Repository navigation
fix: preserve exec bit for unpacked files and keep lookups read-only - #501
Merged
Merged
Conversation
Filesystem.insertFile returned early for unpacked files without recording `executable`, so extractAll wrote unpacked executables as 0644. Record the bit in the unpacked branch too; extractAll already chmods files whose header entry is executable, including unpacked ones. searchNodeFromDirectory created missing intermediate directories even when called from getNode, so a failed statFile/extractFile added phantom directories to the cached header that then showed up in listPackage and extractAll. Add a `create` parameter (default true for packing) and pass false from getNode so lookups return "not found" without mutating the header. Child lookups also check Object.hasOwn so names like "toString" no longer resolve to Object.prototype members of the JSON-parsed header. Refs #499 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PiGRtB1rbGBBVHSbsGRUQ5
MarshallOfSound
approved these changes
Nov 24, 2026
MarshallOfSound
enabled auto-merge (squash)
November 24, 2026 18:22
erickzhao
approved these changes
Nov 24, 2026
|
🎉 This PR is included in version 4.3.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested via Slack thread
Extracting an archive lost the executable bit on unpacked files, because
insertFilereturned early for unpacked entries without ever recordingexecutablein the header. Separately, looking up a missing path (viastatFile,extractFileand friends) created phantom directories in the cached archive header, which then showed up inlistPackageandextractAll, and lookups of names liketoStringresolved toObject.prototypemembers of the JSON-parsed header. This PR records the exec bit for unpacked files, makes lookups read-only and guards child lookups withObject.hasOwn, and adds tests for all three, based on the reproducers @trackoor provided in #499. The directory-symlink traversal bug also reported in #499 (paths more than one level under a directory symlink) is not covered here and stays open.Refs #499
Generated by Claude Code