Hello,
i am wondering if it is possible to isolate an external command using gaol.
i tryed something like this:
fn handle_child()
{
let cmd = env::args().skip(2).next().expect("cmd ...");
let args = env::args().skip(3).map(|v| v.to_string()).collect::<Vec<_>>();
println!("??? {}, {:?}", &cmd, &args);
ChildSandbox::new( profile()).activate().unwrap();
::std::process::Command::new(&cmd)
.args(&args)
.stdin(Stdio::inherit())
.stdout(Stdio::inherit())
.spawn()
.expect("command failed")
;
}
fn main() {
if env::args().skip(1).next().is_some() && env::args().skip(1).next().expect("...") == "child" {
return handle_child();
}
println!("???");
let sandbox = Sandbox::new( profile());
let args = env::args().skip(2).map(|v| v.to_string()).collect::<Vec<_>>();
let res = sandbox.start(
Command::me().unwrap()
.arg("child")
.arg("/usr/bin/true")
// .args(&args)
).unwrap().wait();
}
i don't want to give the child the ability to run ::std::process::Command::new(&cmd).
thanks for any kind of help :)
Hello,
i am wondering if it is possible to isolate an external command using gaol.
i tryed something like this:
i don't want to give the child the ability to run
::std::process::Command::new(&cmd).thanks for any kind of help :)