From e7b7129b7a92b7500ded88f8f5baa25a7f59e56e Mon Sep 17 00:00:00 2001 From: crowlKats <13135287+crowlKats@users.noreply.github.com> Date: Sat, 10 Apr 2021 00:12:00 +0200 Subject: feat(permissions): allow run permission to take values (#9833) This commit adds allowlist support to `--allow-run` flag. Additionally `Deno.permissions.query()` allows to query for specific programs within allowlist. --- runtime/ops/process.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'runtime/ops/process.rs') diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index c2ca2c687..625bc204c 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -96,9 +96,8 @@ fn op_run( run_args: RunArgs, _zero_copy: Option, ) -> Result { - state.borrow::().run.check()?; - let args = run_args.cmd; + state.borrow::().run.check(&args[0])?; let env = run_args.env; let cwd = run_args.cwd; @@ -198,11 +197,6 @@ async fn op_run_status( rid: ResourceId, _zero_copy: Option, ) -> Result { - { - let s = state.borrow(); - s.borrow::().run.check()?; - } - let resource = state .borrow_mut() .resource_table @@ -292,7 +286,7 @@ fn op_kill( _zero_copy: Option, ) -> Result<(), AnyError> { super::check_unstable(state, "Deno.kill"); - state.borrow::().run.check()?; + state.borrow::().run.check_all()?; kill(args.pid, args.signo)?; Ok(()) -- cgit v1.2.3