mirror of
https://github.com/openai/codex.git
synced 2026-05-02 20:32:04 +03:00
codex: dispatch exec-server sandbox helper via argv0
Teach the standalone exec-server binary to run the Linux sandbox helper when it is re-execed with the codex-linux-sandbox argv0 alias. Point the exec-server sandbox transform at the current executable on Linux instead of requiring an env-provided helper path. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -104,9 +104,14 @@ struct ExecServerRuntimeConfig {
|
||||
|
||||
impl ExecServerRuntimeConfig {
|
||||
fn detect() -> Self {
|
||||
let env_path = std::env::var_os("CODEX_LINUX_SANDBOX_EXE").map(PathBuf::from);
|
||||
Self {
|
||||
codex_linux_sandbox_exe: env_path,
|
||||
// The Codex CLI and codex-exec-server both dispatch the Linux
|
||||
// sandbox helper from their own executable via argv[0].
|
||||
codex_linux_sandbox_exe: if cfg!(target_os = "linux") {
|
||||
std::env::current_exe().ok()
|
||||
} else {
|
||||
None
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user