Replace setenv with env list supporting host passthrough
This commit is contained in:
+16
-1
@@ -20,6 +20,21 @@ pub enum SandboxMode {
|
||||
Whitelist,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum EnvEntry {
|
||||
Keep(String),
|
||||
Set(String, String),
|
||||
}
|
||||
|
||||
impl EnvEntry {
|
||||
pub fn key(&self) -> &str {
|
||||
match self {
|
||||
Self::Keep(k) => k,
|
||||
Self::Set(k, _) => k,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct SandboxConfig {
|
||||
pub mode: SandboxMode,
|
||||
pub hardened: bool,
|
||||
@@ -29,7 +44,7 @@ pub struct SandboxConfig {
|
||||
pub extra_rw: Vec<PathBuf>,
|
||||
pub extra_ro: Vec<PathBuf>,
|
||||
pub mask: Vec<PathBuf>,
|
||||
pub setenv: Vec<(String, String)>,
|
||||
pub env: Vec<EnvEntry>,
|
||||
pub unsetenv: Vec<String>,
|
||||
pub bwrap_args: Vec<String>,
|
||||
pub command: PathBuf,
|
||||
|
||||
Reference in New Issue
Block a user