-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes bin overwrites #7755
Fixes bin overwrites #7755
Conversation
|
* Fixes potential file overwrite at install time * Fixes the regexp * Adds warnings * Fixes overzealous removals * Fixes test * Adds tests
Hey @arcanis, we've bumped into a new warning about For example: {
"bin": {
"build.cli": "./cli.js"
}
} |
This breaks my build as well. Some of my bins have dots in their names, including a few that I have no control over. |
Hey @arcanis, this breaks some packages from building because bin key names contain colons. Why so restrictive on the bin key name validation? |
The name check is slightly too restrictive, but I don't have bandwidth to fix that atm. Please open a PR and link it here. |
@arcanis done |
* Fixes potential file overwrite at install time * Fixes the regexp * Adds warnings * Fixes overzealous removals * Fixes test * Adds tests
* Fixes potential file overwrite at install time * Fixes the regexp * Adds warnings * Fixes overzealous removals * Fixes test * Adds tests
- using 1.19.2 as primary version; 1.22.5 has "invalid 'bin'" issues - ref: yarnpkg/yarn#7755 - ref: yarnpkg/yarn#7811 - but... *still* a problem even after PR#7811
- using 1.19.2 as primary version; 1.22.5 has "invalid 'bin'" issues - ref: yarnpkg/yarn#7755 - ref: yarnpkg/yarn#7811 - but... *still* a problem even after PR#7811
Summary
In some circumstances Yarn would allow overwriting files on the filesystem with symlinks at install-time. Despite postinstall scripts having the ability to do that anyway this behavior isn't intended as Yarn installs are reputed to control side effects (the cache and temporary folders being the only exception). Bins shouldn't be able to escape the package because of Yarn.
Test plan
Adding tests