mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Propagate workspace roots to exec-server sandboxes (#32214)
## What changed - Pass configured workspace roots from core to the exec server so filesystem and process sandbox permissions are materialized against the intended roots. - Preserve an explicitly empty workspace-root list instead of treating the sandbox working directory as an implicit root. - Initialize filesystem sandbox contexts with their working directory as the default workspace root. ## Testing - Add end-to-end coverage for patch and command writes inside and outside workspace roots. - Verify remote filesystem and process sandboxes do not grant access through an empty workspace-root list. GitOrigin-RevId: 6684c8f7de50970b45a29e2a6323df954c96f9f6
This commit is contained in:
@@ -72,11 +72,7 @@ impl FileSystemSandboxRunner {
|
||||
.iter()
|
||||
.map(native_workspace_root)
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
let workspace_roots = if native_workspace_roots.is_empty() {
|
||||
std::slice::from_ref(&cwd.native)
|
||||
} else {
|
||||
native_workspace_roots.as_slice()
|
||||
};
|
||||
let workspace_roots = native_workspace_roots.as_slice();
|
||||
let native_permissions: PermissionProfile =
|
||||
sandbox.permissions.clone().try_into().map_err(|err| {
|
||||
invalid_request(format!("invalid sandbox permission path URI: {err}"))
|
||||
|
||||
@@ -56,11 +56,7 @@ pub(crate) fn prepare_exec_request(
|
||||
.iter()
|
||||
.map(|root| native_path(root, "sandbox workspace root"))
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
let workspace_roots = if native_workspace_roots.is_empty() {
|
||||
std::slice::from_ref(&native_sandbox_policy_cwd)
|
||||
} else {
|
||||
native_workspace_roots.as_slice()
|
||||
};
|
||||
let workspace_roots = native_workspace_roots.as_slice();
|
||||
let permissions = permissions.materialize_project_roots_with_workspace_roots(workspace_roots);
|
||||
let managed_mitm_ca_trust_bundle_path = params.managed_network.as_ref().and_then(|_| {
|
||||
CUSTOM_CA_ENV_KEYS.iter().find_map(|key| {
|
||||
|
||||
Reference in New Issue
Block a user