Expand description
Spawn a user-supplied command (e.g. publisher.cmd) with a clean,
whitelisted environment.
Centralised here so the Command::new(<arbitrary>) shell-out lives
inside the module-boundaries allow-list. Inlining this in the CLI
crate would put Command::new outside the allow-list and counts
as a boundary violation.
Constants§
- ENV_
WHITELIST - Environment variables that are inherited from the parent process
when constructing a sandboxed
Command. Anything else must be explicitly added viaCommand::env.
Functions§
- whitelisted
- Construct a
Commandwhose argv isargvand whose environment is reset to theENV_WHITELISTsubset of the parent’s env. The first element ofargvis the program; the rest are arguments. The caller is responsible for adding any further env vars / cwd / I/O config before invokingoutput().