use crate::{SandboxConfig, SandboxMode, SandboxReport, drop_root_step};
pub(crate) fn apply(config: &SandboxConfig) -> anyhow::Result<SandboxReport> {
if config.mode == SandboxMode::Disabled {
log::info!("Sandbox disabled by configuration");
return Ok(SandboxReport {
message: "Sandbox disabled by configuration".to_string(),
..SandboxReport::default()
});
}
let outcome = drop_root_step(
config,
"sockstat process attribution is now limited to that user's processes",
)?;
Ok(SandboxReport::uid_drop_only(
"No sandbox on FreeBSD yet (Capsicum planned)",
&outcome,
))
}