fix(scan): inspect extensionless shebang scripts - #7
Open
vsolano9 wants to merge 1 commit into
Open
Conversation
Probe only the first 64 bytes of extensionless files and collect those beginning with a shebang. Add fixture coverage for finding parity and plain-file exclusion, then bump the patch version and changelog.
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.
What does this PR do?
Collect extensionless directory entries when their first bytes are a shebang, closing the scanner blind spot for executable scripts named
setup,install, orrun. The probe reads at most 64 bytes; plain extensionless files remain ignored.Closes #5
Changes
setupand an equally dangerous plainnotesfile.shcontentValidation
node --test— 12/12 passedsetupfinding, nonotesfindingnode --checkacross source, bin, and test JavaScriptnpm pack --dry-run— expected 8-file zero-dependency 0.1.2 package.binsmoke passedgit diff --checkChecklist
node --test)CHANGELOG.mdentryNotes
The executable-bit alternative was intentionally not used: a shebang is a precise text-script signal, while an executable bit alone may identify a native binary that should not be decoded and scanned as text.