Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2020-03-26 07:55:39 +0300
committercjihrig <cjihrig@gmail.com>2020-04-01 05:05:07 +0300
commit60c4c2b6c557efbb2f8f3a3de147baf987931d41 (patch)
tree6603d92b85181c2d71b5873cba7c7e7d4341a628 /src/node_process_methods.cc
parent75ee5b2622956da74541bf3c6388cae5b5d766cf (diff)
src: runtime deprecate process.umask()
This commit runtime deprecates 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 <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_process_methods.cc')
-rw-r--r--src/node_process_methods.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/node_process_methods.cc b/src/node_process_methods.cc
index 4d53749f098..88f4c1cfbd0 100644
--- a/src/node_process_methods.cc
+++ b/src/node_process_methods.cc
@@ -245,6 +245,17 @@ static void Umask(const FunctionCallbackInfo<Value>& args) {
uint32_t old;
if (args[0]->IsUndefined()) {
+ if (env->emit_insecure_umask_warning()) {
+ env->set_emit_insecure_umask_warning(false);
+ if (ProcessEmitDeprecationWarning(
+ env,
+ "Calling process.umask() with no arguments is prone to race "
+ "conditions and is a potential security vulnerability.",
+ "DEP0139").IsNothing()) {
+ return;
+ }
+ }
+
old = umask(0);
umask(static_cast<mode_t>(old));
} else {