Skip to content

Commit 75ee5b2

Browse files
committed
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>
1 parent 25a1f04 commit 75ee5b2

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

doc/api/deprecations.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,6 +2635,22 @@ modules is unsupported.
26352635
It is deprecated in favor of [`require.main`][], because it serves the same
26362636
purpose and is only available on CommonJS environment.
26372637
2638+
<a id="DEP0XXX"></a>
2639+
### DEP0XXX: `process.umask()` with no arguments
2640+
<!-- YAML
2641+
changes:
2642+
- version: REPLACEME
2643+
pr-url: https://github.com/nodejs/node/pull/32499
2644+
description: Documentation-only deprecation.
2645+
-->
2646+
2647+
Type: Documentation-only
2648+
2649+
Calling `process.umask()` with no arguments causes the process-wide umask to be
2650+
written twice. This introduces a race condition between threads, and is a
2651+
potential security vulnerability. There is no safe, cross-platform alternative
2652+
API.
2653+
26382654
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
26392655
[`--throw-deprecation`]: cli.html#cli_throw_deprecation
26402656
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size

doc/api/process.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,8 +2426,16 @@ flag's behavior.
24262426
## `process.umask([mask])`
24272427
<!-- YAML
24282428
added: v0.1.19
2429+
changes:
2430+
- version: REPLACEME
2431+
pr-url: https://github.com/nodejs/node/pull/32499
2432+
description: Calling `process.umask()` with no arguments is deprecated.
2433+
24292434
-->
24302435

2436+
> Stability: 0 - Deprecated. Calling `process.umask()` with no arguments is
2437+
> deprecated. No alternative is provided.
2438+
24312439
* `mask` {string|integer}
24322440

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

0 commit comments

Comments
 (0)