Skip to content

Commit 4f3d586

Browse files
BethGriggsjoesepi
authored andcommitted
Revert "src: runtime deprecate process.umask()"
This reverts commit 60c4c2b. PR-URL: nodejs#35332 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruy Adorno <[email protected]>
1 parent a446be9 commit 4f3d586

File tree

5 files changed

+2
-31
lines changed

5 files changed

+2
-31
lines changed

doc/api/deprecations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2531,10 +2531,10 @@ purpose and is only available on CommonJS environment.
25312531
changes:
25322532
- version: v14.0.0
25332533
pr-url: https://github.com/nodejs/node/pull/32499
2534-
description: Runtime deprecation.
2534+
description: Documentation-only deprecation.
25352535
-->
25362536

2537-
Type: Runtime
2537+
Type: Documentation-only
25382538

25392539
Calling `process.umask()` with no argument causes the process-wide umask to be
25402540
written twice. This introduces a race condition between threads, and is a

src/env-inl.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -808,14 +808,6 @@ void Environment::set_filehandle_close_warning(bool on) {
808808
emit_filehandle_warning_ = on;
809809
}
810810

811-
bool Environment::emit_insecure_umask_warning() const {
812-
return emit_insecure_umask_warning_;
813-
}
814-
815-
void Environment::set_emit_insecure_umask_warning(bool on) {
816-
emit_insecure_umask_warning_ = on;
817-
}
818-
819811
void Environment::set_source_maps_enabled(bool on) {
820812
source_maps_enabled_ = on;
821813
}

src/env.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,8 +1160,6 @@ class Environment : public MemoryRetainer {
11601160

11611161
inline bool filehandle_close_warning() const;
11621162
inline void set_filehandle_close_warning(bool on);
1163-
inline bool emit_insecure_umask_warning() const;
1164-
inline void set_emit_insecure_umask_warning(bool on);
11651163

11661164
inline void set_source_maps_enabled(bool on);
11671165
inline bool source_maps_enabled() const;
@@ -1386,7 +1384,6 @@ class Environment : public MemoryRetainer {
13861384
bool emit_env_nonstring_warning_ = true;
13871385
bool emit_err_name_warning_ = true;
13881386
bool emit_filehandle_warning_ = true;
1389-
bool emit_insecure_umask_warning_ = true;
13901387
bool source_maps_enabled_ = false;
13911388

13921389
size_t async_callback_scope_depth_ = 0;

src/node_process_methods.cc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,6 @@ static void Umask(const FunctionCallbackInfo<Value>& args) {
206206

207207
uint32_t old;
208208
if (args[0]->IsUndefined()) {
209-
if (env->emit_insecure_umask_warning()) {
210-
env->set_emit_insecure_umask_warning(false);
211-
if (ProcessEmitDeprecationWarning(
212-
env,
213-
"Calling process.umask() with no arguments is prone to race "
214-
"conditions and is a potential security vulnerability.",
215-
"DEP0139").IsNothing()) {
216-
return;
217-
}
218-
}
219-
220209
old = umask(0);
221210
umask(static_cast<mode_t>(old));
222211
} else {

test/parallel/test-process-umask.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ if (common.isWindows) {
4040
mask = '0664';
4141
}
4242

43-
common.expectWarning(
44-
'DeprecationWarning',
45-
'Calling process.umask() with no arguments is prone to race conditions ' +
46-
'and is a potential security vulnerability.',
47-
'DEP0139'
48-
);
49-
5043
const old = process.umask(mask);
5144

5245
assert.strictEqual(process.umask(old), parseInt(mask, 8));

0 commit comments

Comments
 (0)