-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: apply
securePath
to package bin (#105)
## What / Why * Aligns path normalization logic when processing `bin` and `man` refs. * Fixes out of scope path traversals for `bin` ```js function unixifyPath (ref) { return ref.replace(/\\|:/g, '/') } function securePath (ref) { const secured = path.join('.', path.join('/', unixifyPath(ref))) return secured.startsWith('.') ? '' : secured } function secureAndUnixifyPath (ref) { return unixifyPath(securePath(ref)) } ``` ## References continues [#100](#100 (comment)), #104
- Loading branch information
1 parent
46c563b
commit 54756d2
Showing
2 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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