From 75ee5b2622956da74541bf3c6388cae5b5d766cf Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 26 Mar 2020 01:07:31 -0400 Subject: doc: deprecate process.umask() with no arguments This commit introduces a documentation deprecation for calling process.umask() with no arguments. PR-URL: https://github.com/nodejs/node/pull/32499 Fixes: https://github.com/nodejs/node/issues/32321 Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- doc/api/deprecations.md | 16 ++++++++++++++++ doc/api/process.md | 8 ++++++++ 2 files changed, 24 insertions(+) (limited to 'doc/api') diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 7bce3bcff3a..bb3224a7360 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -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. + +### DEP0XXX: `process.umask()` with no arguments + + +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 diff --git a/doc/api/process.md b/doc/api/process.md index 1c1089ca6b8..f15bfcc2be0 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2426,8 +2426,16 @@ flag's behavior. ## `process.umask([mask])` +> 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 -- cgit v1.2.3