Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: deprecate process.umask() with no arguments
This commit introduces a documentation deprecation for calling
process.umask() with no arguments.

PR-URL: #32499
Fixes: #32321
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
cjihrig committed Apr 1, 2020
commit 75ee5b2622956da74541bf3c6388cae5b5d766cf
16 changes: 16 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2635,6 +2635,22 @@ modules is unsupported.
It is deprecated in favor of [`require.main`][], because it serves the same
purpose and is only available on CommonJS environment.

<a id="DEP0XXX"></a>
### DEP0XXX: `process.umask()` with no arguments
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/32499
description: Documentation-only deprecation.
-->

Type: Documentation-only

Calling `process.umask()` with no arguments causes the process-wide umask to be
written twice. This introduces a race condition between threads, and is a
potential security vulnerability. There is no safe, cross-platform alternative
API.

[`--pending-deprecation`]: cli.html#cli_pending_deprecation
[`--throw-deprecation`]: cli.html#cli_throw_deprecation
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
Expand Down
8 changes: 8 additions & 0 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2426,8 +2426,16 @@ flag's behavior.
## `process.umask([mask])`
<!-- YAML
added: v0.1.19
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/32499
description: Calling `process.umask()` with no arguments is deprecated.

-->

> Stability: 0 - Deprecated. Calling `process.umask()` with no arguments is
> deprecated. No alternative is provided.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stability setting isn't right, is it? The stability applies to the method, not a particular use of the method. That will make it look like the method is deprecated itself, but it's not. We don't do this for any other methods. I'm going to open a PR to change this to a paragraph rather than a stability banner.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could provide separate entries for process.umask() and process.umask(mask) 🤷‍♀️

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that could work too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


* `mask` {string|integer}

The `process.umask()` method sets or returns the Node.js process's file mode
Expand Down