diff options
author | Rich Trott <rtrott@gmail.com> | 2020-04-08 02:17:14 +0300 |
---|---|---|
committer | Beth Griggs <Bethany.Griggs@uk.ibm.com> | 2020-04-14 13:03:52 +0300 |
commit | 1db8da21f2c134317fd557ca4822fd91e2748b5e (patch) | |
tree | e1caacba69a11a3c235906f74045c6dfa543b6b9 /doc/api | |
parent | b68e26ee70e6615e17f1f35da467c87979fa3263 (diff) |
doc: split process.umask() entry into two
Split doc entries for process.umask() into one entry for process.umask()
(which is deprecated) and another for `process.umask(mask)` which is
not deprecated.
PR-URL: https://github.com/nodejs/node/pull/32711
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/deprecations.md | 2 | ||||
-rw-r--r-- | doc/api/process.md | 25 |
2 files changed, 17 insertions, 10 deletions
diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index bb3224a7360..9425ae1e24a 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2646,7 +2646,7 @@ changes: Type: Documentation-only -Calling `process.umask()` with no arguments causes the process-wide umask to be +Calling `process.umask()` with no argument 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. diff --git a/doc/api/process.md b/doc/api/process.md index f15bfcc2be0..4fff2a877ce 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2423,7 +2423,7 @@ documentation for the [`'warning'` event][process_warning] and the [`emitWarning()` method][process_emit_warning] for more information about this flag's behavior. -## `process.umask([mask])` +## `process.umask()` <!-- YAML added: v0.1.19 changes: @@ -2433,15 +2433,23 @@ changes: --> -> Stability: 0 - Deprecated. Calling `process.umask()` with no arguments is -> deprecated. No alternative is provided. +> Stability: 0 - Deprecated. Calling `process.umask()` with no argument 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. + +`process.umask()` returns the Node.js process's file mode creation mask. Child +processes inherit the mask from the parent process. + +## `process.umask(mask)` +<!-- YAML +added: v0.1.19 +--> * `mask` {string|integer} -The `process.umask()` method sets or returns the Node.js process's file mode -creation mask. Child processes inherit the mask from the parent process. Invoked -without an argument, the current mask is returned, otherwise the umask is set to -the argument value and the previous mask is returned. +`process.umask(mask)` sets the Node.js process's file mode creation mask. Child +processes inherit the mask from the parent process. Returns the previous mask. ```js const newmask = 0o022; @@ -2451,8 +2459,7 @@ console.log( ); ``` -[`Worker`][] threads are able to read the umask, however attempting to set the -umask will result in a thrown exception. +In [`Worker`][] threads, `process.umask(mask)` will throw an exception. ## `process.uptime()` <!-- YAML |