From 72cab6703fee5d0a43084a64e6d85cd2b4cc7d8a Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Fri, 5 May 2023 23:11:40 +0900 Subject: [PATCH] src: rename the variable storing permission for child_process and worker Signed-off-by: Daeyeon Jeong --- src/env.cc | 4 ++-- src/permission/child_process_permission.cc | 4 ++-- src/permission/child_process_permission.h | 2 +- src/permission/worker_permission.cc | 4 ++-- src/permission/worker_permission.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/env.cc b/src/env.cc index ff8d3952cf20a3..93d3b6b2302c2c 100644 --- a/src/env.cc +++ b/src/env.cc @@ -796,10 +796,10 @@ Environment::Environment(IsolateData* isolate_data, // spawn/worker nor use addons unless explicitly allowed by the user if (!options_->allow_fs_read.empty() || !options_->allow_fs_write.empty()) { options_->allow_native_addons = false; - if (!options_->allow_child_process) { + if (options_->allow_child_process) { permission()->Apply("*", permission::PermissionScope::kChildProcess); } - if (!options_->allow_worker_threads) { + if (options_->allow_worker_threads) { permission()->Apply("*", permission::PermissionScope::kWorkerThreads); } } diff --git a/src/permission/child_process_permission.cc b/src/permission/child_process_permission.cc index 7151eb15f90da2..e231dbd3785a97 100644 --- a/src/permission/child_process_permission.cc +++ b/src/permission/child_process_permission.cc @@ -11,12 +11,12 @@ namespace permission { // Once denied, it's always denied void ChildProcessPermission::Apply(const std::string& allow, PermissionScope scope) { - deny_all_ = true; + is_all_allowed_ = true; } bool ChildProcessPermission::is_granted(PermissionScope perm, const std::string_view& param) { - return deny_all_ == false; + return is_all_allowed_; } } // namespace permission diff --git a/src/permission/child_process_permission.h b/src/permission/child_process_permission.h index b67169f1c4e180..561708d211253b 100644 --- a/src/permission/child_process_permission.h +++ b/src/permission/child_process_permission.h @@ -17,7 +17,7 @@ class ChildProcessPermission final : public PermissionBase { const std::string_view& param = "") override; private: - bool deny_all_; + bool is_all_allowed_{false}; }; } // namespace permission diff --git a/src/permission/worker_permission.cc b/src/permission/worker_permission.cc index 69c89a4a4fea87..de3e1b949dfe87 100644 --- a/src/permission/worker_permission.cc +++ b/src/permission/worker_permission.cc @@ -10,12 +10,12 @@ namespace permission { // Currently, PolicyDenyWorker manage a single state // Once denied, it's always denied void WorkerPermission::Apply(const std::string& allow, PermissionScope scope) { - deny_all_ = true; + is_all_allowed_ = true; } bool WorkerPermission::is_granted(PermissionScope perm, const std::string_view& param) { - return deny_all_ == false; + return is_all_allowed_; } } // namespace permission diff --git a/src/permission/worker_permission.h b/src/permission/worker_permission.h index 71681a4485a82f..ed03ffc42e49ca 100644 --- a/src/permission/worker_permission.h +++ b/src/permission/worker_permission.h @@ -17,7 +17,7 @@ class WorkerPermission final : public PermissionBase { const std::string_view& param = "") override; private: - bool deny_all_; + bool is_all_allowed_{false}; }; } // namespace permission