From 0a927216cf862fd336879034c913b3a59a13d491 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 26 Mar 2020 01:07:31 -0400 Subject: [PATCH] doc: deprecate process.umask() with no arguments This commit introduces a documentation deprecation for calling process.umask() with no arguments. Backport-PR-URL: https://github.com/nodejs/node/pull/34591 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 | 18 ++++++++++++++++++ doc/api/process.md | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 0d3f6a785be2aa..c850c5c16cf781 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2542,6 +2542,24 @@ accordingly instead to avoid the ambigiuty. To maintain existing behaviour `response.finished` should be replaced with `response.writableEnded`. + +### DEP0139: `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. + [`--http-parser=legacy`]: cli.html#cli_http_parser_library [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`--throw-deprecation`]: cli.html#cli_throw_deprecation diff --git a/doc/api/process.md b/doc/api/process.md index 2fb0b77f7df702..d9b776fdbc9f04 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2396,8 +2396,18 @@ 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