mirror of
https://github.com/openai/codex.git
synced 2026-10-20 00:18:49 +00:00
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
This commit is contained in:
@@ -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"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user