From f817e1690570aac60480babbd2243cc991ba2118 Mon Sep 17 00:00:00 2001 From: aionescu-oai Date: Mon, 28 Sep 2026 16:30:33 +0000 Subject: [PATCH] Use the numeric ioctl value in the macOS sandbox policy (#49028) Older macOS policy compilers do not define the `TIOCSTI` symbol. Generate the sandbox CLI's Seatbelt deny rule with the numeric value from `libc::TIOCSTI` so it remains compatible while blocking terminal input injection. GitOrigin-RevId: de8113fbab92bb399f37b9a22762c5c649f25972 --- codex-rs/cli/src/debug_sandbox.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codex-rs/cli/src/debug_sandbox.rs b/codex-rs/cli/src/debug_sandbox.rs index 55d71d6dc0..73dd99cfe8 100644 --- a/codex-rs/cli/src/debug_sandbox.rs +++ b/codex-rs/cli/src/debug_sandbox.rs @@ -413,7 +413,11 @@ async fn run_command_under_sandbox( // for the unsandboxed shell that resumes when Codex exits. match args.as_mut_slice() { [flag, policy, ..] if flag.as_str() == "-p" => { - policy.push_str("\n(deny file-ioctl (ioctl-command TIOCSTI))"); + // Older macOS policy compilers do not define the TIOCSTI symbol. + policy.push_str(&format!( + "\n(deny file-ioctl (ioctl-command {}))", + libc::TIOCSTI + )); } _ => anyhow::bail!("Seatbelt command is missing its generated policy"), }