Skip to content

Commit

Permalink
doc: deprecate process.umask() with no arguments
Browse files Browse the repository at this point in the history
This commit introduces a documentation deprecation for calling
process.umask() with no arguments.

Backport-PR-URL: #34591
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 authored and BethGriggs committed Sep 15, 2020
1 parent ec1df7b commit 0a92721
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/api/deprecations.md
Expand Up @@ -2542,6 +2542,24 @@ accordingly instead to avoid the ambigiuty.
To maintain existing behaviour `response.finished` should be replaced with
`response.writableEnded`.

<a id="DEP0139"></a>
### DEP0139: `process.umask()` with no arguments
<!-- YAML
changes:
- version:
- v14.0.0
- 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.

[`--http-parser=legacy`]: cli.html#cli_http_parser_library
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
[`--throw-deprecation`]: cli.html#cli_throw_deprecation
Expand Down
10 changes: 10 additions & 0 deletions doc/api/process.md
Expand Up @@ -2396,8 +2396,18 @@ flag's behavior.
## `process.umask([mask])`
<!-- YAML
added: v0.1.19
changes:
- version:
- v14.0.0
- 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.
* `mask` {string|integer}

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

0 comments on commit 0a92721

Please sign in to comment.