Skip to main content

wrap_command

Function wrap_command 

Source
pub fn wrap_command(
    program: &str,
    args: &[String],
    cwd: &Path,
    caps: &Capabilities,
) -> (Command, SandboxLayer)
Expand description

Wrap a user-provided command + argv into a tokio::process::Command that is ready to spawn under the resolved sandbox layer. Returns (Command, SandboxLayer) so the caller can record the actual layer in its audit log.

program is the binary to run (e.g. git, sh); args are its CLI arguments. The wrapper may prepend sandbox-exec -p ... etc., but the caller still sees the chosen layer through the returned tuple.