mirror of
https://github.com/openai/codex.git
synced 2026-11-16 22:00:36 +00:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user