fix(hosts): normalize the Rust tree before its receipt is written - #45
Merged
Conversation
Found by auditing the machine after the 2.4.0 apply: the published Rust tree root was 0775. Its bundled install.sh creates the prefix under the caller's umask, so `umask 002` leaves it group-writable. Go and Node avoid this only because their trees come from `mktemp -d` at 0700 - luck, not a guarantee. The receipt covers five executables, so a writable directory beside them is enough to add a library without invalidating it. Same reasoning as the Dart tree, same shared helper, applied before the receipt is written. Node's npm/npx/corepack entries match `find -perm /022` but are symlinks, whose mode bits Linux ignores; the shared helper skips symlinks after checking containment, so it is correctly a no-op there. No change was needed for Go or Node.
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.
Found by auditing the machine after the 2.4.0 apply.
The published Rust tree root was 0775. Its bundled
install.shcreates the prefix under the caller's umask, soumask 002leaves it group-writable. Go and Node avoid this only because their trees come frommktemp -dat 0700 - luck, not a guarantee.The receipt covers five executables (
rustc,cargo,rust-analyzer,rustfmt,clippy-driver), so a writable directory beside them is enough to add a library without invalidating it. Same reasoning as the Dart tree in #43, same shared helper, applied before the receipt is written.Deliberately not changed
Node's
npm/npx/corepackentries matchfind -perm /022but are symlinks, whose mode bits Linux ignores. The shared helper skips symlinks after checking containment, so it is correctly a no-op there. Go's tree measured 0 group-writable paths. Neither needed a change, and adding one would be noise.Evidence
Measured on the reporting host, before and after running the same helper the installer now invokes:
python3 -m pytestscripts/ci/validate.sh/lint.shci-validate-ok/scripts-lint-ok