mirror of
https://github.com/openai/codex.git
synced 2026-05-03 12:52:11 +03:00
codex: share linux sandbox arg0 dispatch
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -25,3 +25,19 @@ pub fn run_main() -> ! {
|
||||
pub fn run_main() -> ! {
|
||||
panic!("codex-linux-sandbox is only supported on Linux");
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
pub fn dispatch_if_requested() {
|
||||
let argv0 = std::env::args_os().next().unwrap_or_default();
|
||||
let exe_name = std::path::Path::new(&argv0)
|
||||
.file_name()
|
||||
.and_then(|s| s.to_str())
|
||||
.unwrap_or("");
|
||||
|
||||
if exe_name == codex_sandboxing::landlock::CODEX_LINUX_SANDBOX_ARG0 {
|
||||
run_main();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
pub fn dispatch_if_requested() {}
|
||||
|
||||
Reference in New Issue
Block a user