mirror of
https://github.com/openai/codex.git
synced 2026-11-12 21:20:34 +00:00
## Why Remote commands can use workspace paths from a different operating system. Preparing them on the client should preserve those paths and command arguments for the execution host. ## What changed - Build exec-server requests directly, carrying the native command and sandbox context without applying the client's sandbox transform. - Resolve workspace permissions and runtime read access in `SandboxManager` on the execution host, including helper binaries and validated managed-network CA bundles. - Add explicit backend selection and required platform sandbox selection, rejecting launches when the required sandbox is unavailable. ## Testing Extend request tests to cover foreign workspace paths, Unicode arguments, and empty arguments. Extend the remote process test on Unix to verify that restricted reads allow the sandbox helper and validated CA bundle while denying an untrusted certificate file. GitOrigin-RevId: 5fc02ac4208912ecefb80a212742389afc14ac05
35 lines
1.3 KiB
Rust
35 lines
1.3 KiB
Rust
//! Translates Windows sandbox selection and validates explicit remote MXC requests.
|
|
|
|
use codex_file_system::FileSystemSandboxContext;
|
|
use codex_file_system::WindowsSandboxSelection;
|
|
use codex_protocol::config_types::WindowsSandboxLevel;
|
|
use codex_sandboxing::SandboxSelection;
|
|
use codex_sandboxing::SandboxType;
|
|
|
|
pub(crate) fn validate_remote_mxc(info: &crate::EnvironmentInfo) -> std::io::Result<()> {
|
|
if !info.capabilities.windows_mxc {
|
|
return Err(std::io::Error::new(
|
|
std::io::ErrorKind::Unsupported,
|
|
"exec-server does not support the requested MXC Windows sandbox; update the executor",
|
|
));
|
|
}
|
|
Ok(())
|
|
}
|
|
|
|
pub(crate) fn sandbox_selection(
|
|
context: &FileSystemSandboxContext,
|
|
) -> (SandboxSelection, WindowsSandboxLevel) {
|
|
let level = match context.windows_sandbox_selection {
|
|
WindowsSandboxSelection::Disabled => WindowsSandboxLevel::Disabled,
|
|
WindowsSandboxSelection::RestrictedToken => WindowsSandboxLevel::RestrictedToken,
|
|
WindowsSandboxSelection::Elevated => WindowsSandboxLevel::Elevated,
|
|
WindowsSandboxSelection::Mxc => {
|
|
return (
|
|
SandboxSelection::Explicit(SandboxType::WindowsMxc),
|
|
WindowsSandboxLevel::Disabled,
|
|
);
|
|
}
|
|
};
|
|
(SandboxSelection::RequirePlatform, level)
|
|
}
|