Centralize Windows sandbox filesystem override resolution (#60042)

Add `WindowsSandboxFilesystemOverrides::resolve` to select the elevated or
restricted-token resolver, and use it in core, exec-server, and direct-spawn
sandbox preparation. Pass the child environment through to the elevated
resolver.

Replace the exported unsupported-sandbox reason helper with a test-local
wrapper around the shared resolver.

GitOrigin-RevId: f1d404356a4f680ce81123bc8284508f27d4d6ab
This commit is contained in:
viyatb-oai
2026-11-07 02:46:41 +00:00
committed by copyberry
parent 11ca3f7531
commit a90c808408
7 changed files with 68 additions and 93 deletions
+16
View File
@@ -556,6 +556,22 @@ fn windows_sandbox_backend_honors_unelevated_configuration() {
));
}
fn unsupported_windows_restricted_token_sandbox_reason(
sandbox: SandboxType,
permission_profile: &PermissionProfile,
sandbox_policy_cwd: &AbsolutePathBuf,
windows_sandbox_level: WindowsSandboxLevel,
) -> Option<String> {
WindowsSandboxFilesystemOverrides::resolve(
sandbox,
permission_profile,
sandbox_policy_cwd,
windows_sandbox_level,
&HashMap::new(),
)
.err()
}
#[test]
fn windows_restricted_token_rejects_network_only_restrictions() {
let permission_profile = PermissionProfile::from_runtime_permissions(