@@ -2393,27 +2393,35 @@ documentation for the [`'warning'` event][process_warning] and the
2393
2393
[ ` emitWarning() ` method] [ process_emit_warning ] for more information about this
2394
2394
flag's behavior.
2395
2395
2396
- ## ` process.umask([mask] ) `
2396
+ ## ` process.umask() `
2397
2397
<!-- YAML
2398
2398
added: v0.1.19
2399
2399
changes:
2400
2400
- version:
2401
- - v14.0.0
2402
2401
- REPLACEME
2402
+ - v14.0.0
2403
2403
pr-url: https://github.com/nodejs/node/pull/32499
2404
2404
description: Calling `process.umask()` with no arguments is deprecated.
2405
2405
2406
2406
-->
2407
2407
2408
- > Stability: 0 - Deprecated. Calling ` process.umask() ` with no arguments is
2409
- > deprecated. No alternative is provided.
2408
+ > Stability: 0 - Deprecated. Calling ` process.umask() ` with no argument causes
2409
+ > the process-wide umask to be written twice. This introduces a race condition
2410
+ > between threads, and is a potential security vulnerability. There is no safe,
2411
+ > cross-platform alternative API.
2412
+
2413
+ ` process.umask() ` returns the Node.js process's file mode creation mask. Child
2414
+ processes inherit the mask from the parent process.
2415
+
2416
+ ## ` process.umask(mask) `
2417
+ <!-- YAML
2418
+ added: v0.1.19
2419
+ -->
2410
2420
2411
2421
* ` mask ` {string|integer}
2412
2422
2413
- The ` process.umask() ` method sets or returns the Node.js process's file mode
2414
- creation mask. Child processes inherit the mask from the parent process. Invoked
2415
- without an argument, the current mask is returned, otherwise the umask is set to
2416
- the argument value and the previous mask is returned.
2423
+ ` process.umask(mask) ` sets the Node.js process's file mode creation mask. Child
2424
+ processes inherit the mask from the parent process. Returns the previous mask.
2417
2425
2418
2426
``` js
2419
2427
const newmask = 0o022 ;
@@ -2423,8 +2431,7 @@ console.log(
2423
2431
);
2424
2432
```
2425
2433
2426
- [ ` Worker ` ] [ ] threads are able to read the umask, however attempting to set the
2427
- umask will result in a thrown exception.
2434
+ In [ ` Worker ` ] [ ] threads, ` process.umask(mask) ` will throw an exception.
2428
2435
2429
2436
## ` process.uptime() `
2430
2437
<!-- YAML
0 commit comments