fix(pm): normalize extracted file permissions to 0o644/0o755#2800
Merged
fireairforce merged 2 commits intonextfrom Apr 17, 2026
Merged
fix(pm): normalize extracted file permissions to 0o644/0o755#2800fireairforce merged 2 commits intonextfrom
fireairforce merged 2 commits intonextfrom
Conversation
Some npm tarballs ship files with restrictive modes (e.g. google-protobuf 4.0.2's package.json, main entry, and READMEs are all 0o640). Preserving raw tar modes left those files unreadable by "other" and broke container and cross-user reads. npm and pnpm both normalize extraction permissions, so match that behavior: 0o755 if any exec bit is present in the header, 0o644 otherwise. The existing skip-chmod-for-0o644 fast path still kicks in for typical files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces tarball permission normalization during the extraction process to ensure that files are world-readable, aligning with npm and pnpm conventions. Files with any executable bit set are now normalized to 0o755, while all others are set to 0o644. Additionally, an end-to-end test case was added to verify this behavior using the google-protobuf package and to prevent future regressions. I have no feedback to provide.
fireairforce
approved these changes
Apr 17, 2026
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.
Summary
google-protobuf@4.0.2'spackage.json,google-protobuf.js,README.md, andLICENSE*are all0o640). Preserving the raw tar mode leaves those files unreadable by "other", which breaks container runtimes and multi-user setups.0o755if any exec bit is set in the header,0o644otherwise. The existing skip-chmod-for-0o644fast path still applies to typical files.e2e/utoo-pm.shthat installsgoogle-protobuf@4.0.2into a temp dir (cold cache forced) and asserts every file is world-readable andpackage.jsonis exactly0o644.Repro (before)
After this change they land at
0o644, matchingnpm install/pnpm install.Test plan
cargo test -p utoo-pm./e2e/utoo-pm.sh— new "tarball permission normalization" case passesnode_modules/google-protobuf/*.js,*.md,package.jsonall0o644after cold install🤖 Generated with Claude Code