Repository navigation
Description
Relevant area(s)
Windows
Brief description of your issue
When using the MXC Rust SDK, and Tier 1 or 2 are not available, Tier 3 (AppContainer + DACL) does not activate. Instead, it will just return an error that says bfscfg.exe is not available on this Windows build ....
This falls back as expected when invoking wxc-exec rather than using the Rust SDK.
Running on Windows 11 25H2.
Steps to reproduce
Example Code:
use std::io::stdout;
use mxc_sdk::{
SandboxPolicy, build_request,
policy::{FilesystemSection, NetworkSection, UiSection},
};
fn main() -> Result<(), mxc_sdk::Error> {
// Set this to actual java path
let java_path = "".to_owned();
let policy = SandboxPolicy {
version: "0.7.0-alpha".to_owned(),
filesystem: Some(FilesystemSection {
readwrite_paths: vec![],
readonly_paths: vec![java_path],
denied_paths: vec![],
clear_policy_on_exit: Some(true),
}),
network: Some(NetworkSection {
allow_outbound: true,
allow_local_network: true,
..Default::default()
}),
ui: Some(UiSection {
allow_windows: true,
clipboard: mxc_sdk::policy::ClipboardPolicy::All,
allow_input_injection: true,
}),
timeout_ms: None,
};
let mut request = build_request(&policy, None)?;
request.set_script("java.exe --version");
let mut sandbox = mxc_sdk::spawn_sandbox(request)?;
let mut child_stdout = sandbox.take_stdout().unwrap();
let mut parent_stdout = stdout();
std::io::copy(&mut child_stdout, &mut parent_stdout).unwrap();
Ok(())
}Expected behavior
In this example, Java version would output as expected. Same thing would happen to any other program. SDK gracefully falls back to Tier 3.
Actual behavior
Returns an error that bfscfg.exe could not be located.
Error { code: BackendError, message: "Filesystem policy error: bfscfg.exe is not available on this Windows build, so the AppContainer + BFS filesystem tier cannot enforce your policy. Use an OS build that includes bfscfg.exe, or run on a host that supports the BaseContainer backend (which does not require bfscfg.exe)." }
Activity
fix(sdk): reach the AppContainer + DACL tier from the streaming path (#…