-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Stop using process.umask() #1103
Comments
The For pacote and bin-links, we can default it to 0, since as you say, the process will enforce its own by default. But for node-tar, it's a bit more tricky, as being able to read the default umask allows us to skip a lot of unnecessary stat and chmod calls. Once the dependencies are no longer using it, we can remove the |
One extremely hacky solution we could use to make things work for older npm clients where we might not want to do all the work to unwind old deps depending on if (typeof process.umask !== 'function')
process.umask = () => 0o22 Would mean that debian users don't get group-writable files, but safer than accidentally creating world-writable bins, and better than crashing entirely. |
This has the benefit of removing a `process.umask()` that causes a runtime deprecation warning if commands such as `npm ls` are run either with Node.js pending deprecations enabled or with the current 15.0.0 RC. Refs: nodejs/node#35332 (comment) Refs: npm#1103
This has the benefit of removing a `process.umask()` that causes a runtime deprecation warning if commands such as `npm ls` are run either with Node.js pending deprecations enabled or with the current 15.0.0 RC. Refs: nodejs/node#35332 (comment) Refs: npm#1103
This allows a way to suppress the call to process.umask() while still being as compliant as possible with the modes as defined in the tarball entries. Re: npm/cli#1103
This allows a way to suppress the call to process.umask() while still being as compliant as possible with the modes as defined in the tarball entries. Re: npm/cli#1103
This allows a way to suppress the call to process.umask() while still being as compliant as possible with the modes as defined in the tarball entries. Re: npm/cli#1103
Since we now are using pacote/tar in a way that will rely on the default process umask setting, and we set file/directory modes explicitly anyway, there's no need to have a default umask setting that calls process.umask() As this method is not worker-thread safe, and is deprecated, it's best for us to stop using it. Fix: #1103
This allows a way to suppress the call to process.umask() while still being as compliant as possible with the modes as defined in the tarball entries. Re: npm/cli#1103
Since we now are using pacote/tar in a way that will rely on the default process umask setting, and we set file/directory modes explicitly anyway, there's no need to have a default umask setting that calls process.umask() As this method is not worker-thread safe, and is deprecated, it's best for us to stop using it. Fix: #1103
Since we now are using pacote/tar in a way that will rely on the default process umask setting, and we set file/directory modes explicitly anyway, there's no need to have a default umask setting that calls process.umask() As this method is not worker-thread safe, and is deprecated, it's best for us to stop using it. Fix: #1103
This allows a way to suppress the call to process.umask() while still being as compliant as possible with the modes as defined in the tarball entries. Re: npm/cli#1103 PR-URL: #270 Credit: @isaacs Close: #270 Reviewed-by: @ruyadorno
Since we now are using pacote/tar in a way that will rely on the default process umask setting, and we set file/directory modes explicitly anyway, there's no need to have a default umask setting that calls process.umask() As this method is not worker-thread safe, and is deprecated, it's best for us to stop using it. Fix: #1103
Since we now are using pacote/tar in a way that will rely on the default process umask setting, and we set file/directory modes explicitly anyway, there's no need to have a default umask setting that calls process.umask() As this method is not worker-thread safe, and is deprecated, it's best for us to stop using it. Fix: #1103
Refs: nodejs/node#32321
Summary:
process.umask()
(no args) will be deprecated and removed.I couldn't quite divine what
lib/config/defaults.js
usesprocess.umask()
for but in most cases you don't need to deal with the umask directly - the operating system will apply it automatically.Example:
Computing the file mode that way is superfluous, it can be replaced with just this:
The text was updated successfully, but these errors were encountered: