linux-sandbox: plumb split sandbox policies through helper

This commit is contained in:
Michael Bolin
2026-03-04 01:44:43 -08:00
parent ed7a864c46
commit 6790e7fa4a
6 changed files with 313 additions and 47 deletions

View File

@@ -1096,6 +1096,22 @@ impl FromStr for SandboxPolicy {
}
}
impl FromStr for FileSystemSandboxPolicy {
type Err = serde_json::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
serde_json::from_str(s)
}
}
impl FromStr for NetworkSandboxPolicy {
type Err = serde_json::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
serde_json::from_str(s)
}
}
impl SandboxPolicy {
/// Returns a policy with read-only disk access and no network.
pub fn new_read_only_policy() -> Self {