Restore persistent system path composition

This commit is contained in:
ms2k 2026-07-22 03:07:42 +09:00
commit 7aff8e542e

View file

@ -28,16 +28,18 @@ pub const DEV_DESTINATION: &str = "/dev";
/// # Errors
/// Returns an error if the fixed destination contract is not a closed normalized layout.
pub fn default_sandbox_layout() -> Result<SandboxLayoutV1, ConfigurationError> {
SandboxLayoutV1::from_protected_destinations([
WORKSPACE_DESTINATION.to_owned(),
CONTROL_ROOT_DESTINATION.to_owned(),
PROC_DESTINATION.to_owned(),
SYS_DESTINATION.to_owned(),
DEV_DESTINATION.to_owned(),
RESOLV_CONF_DESTINATION.to_owned(),
HOSTS_DESTINATION.to_owned(),
HOSTNAME_DESTINATION.to_owned(),
])
SandboxLayoutV1::from_destination_policy(
[
WORKSPACE_DESTINATION.to_owned(),
CONTROL_ROOT_DESTINATION.to_owned(),
PROC_DESTINATION.to_owned(),
SYS_DESTINATION.to_owned(),
DEV_DESTINATION.to_owned(),
],
RUNTIME_FILE_DESTINATIONS
.iter()
.map(|(_, destination)| (*destination).to_owned()),
)
}
#[cfg(test)]
@ -61,5 +63,14 @@ mod tests {
WORKSPACE_DESTINATION.to_owned(),
])
);
assert_eq!(
default_sandbox_layout()
.unwrap()
.nested_transient_overrides(),
&RUNTIME_FILE_DESTINATIONS
.iter()
.map(|(_, destination)| (*destination).to_owned())
.collect()
);
}
}