Repository navigation
Fix explicit Bash destinations and link entry validation - #5333
Merged
Merged
Conversation
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.
Explicit npm prefixes and ln destinations were missing from the shared Bash write scanner, allowing those commands to bypass destination checks. Recognize npm install prefixes, ln link entries, and GNU install target-directory children while preserving quoted option values and rejecting unresolved destinations.
Carry content and entry targets through write-prefix, installation, Git-ref, run_cmd, and diagnostic consumers. Entry checks resolve the parent and preserve the final basename, so replacing an outside link that points inside remains denied; content writes continue to validate the resolved referent. Document the supported forms, npm cache/script limits, and filesystem race limitations.
Regression coverage includes the full observed compound npm/ln commands at the actual write guard, sibling paths sharing an allowed root's text prefix for both content and entry targets, and long-form contradictory target-directory options.
Validation:
pre-commit run --all-filespassed.task test-local-gatewith conservative filtering: 46,210 passed, 510 skipped, 13 xfailed.Closes #5329