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
-2
View File
@@ -49,8 +49,6 @@ use codex_sandboxing::record_filesystem_sandbox_violation;
use codex_sandboxing::resolve_windows_elevated_filesystem_overrides;
#[cfg(test)]
use codex_sandboxing::resolve_windows_restricted_token_filesystem_overrides;
#[cfg(test)]
use codex_sandboxing::unsupported_windows_restricted_token_sandbox_reason;
#[cfg(any(test, target_os = "windows"))]
use codex_sandboxing::windows_sandbox_uses_elevated_backend;
use codex_utils_absolute_path::AbsolutePathBuf;