Revert "Revert "Overhaul shell detection and centralize command generation for unified exec"" (#6607)

Reverts openai/codex#6606
This commit is contained in:
pakrym-oai
2025-11-13 16:45:17 -08:00
committed by GitHub
parent db2aa57d73
commit 7b027e7536
11 changed files with 300 additions and 412 deletions
@@ -1,4 +1,5 @@
use crate::bash::parse_shell_lc_plain_commands;
use crate::command_safety::windows_safe_commands::is_safe_command_windows;
pub fn is_known_safe_command(command: &[String]) -> bool {
let command: Vec<String> = command
@@ -11,12 +12,9 @@ pub fn is_known_safe_command(command: &[String]) -> bool {
}
})
.collect();
#[cfg(target_os = "windows")]
{
use super::windows_safe_commands::is_safe_command_windows;
if is_safe_command_windows(&command) {
return true;
}
if is_safe_command_windows(&command) {
return true;
}
if is_safe_to_call_with_exec(&command) {
-1
View File
@@ -1,4 +1,3 @@
pub mod is_dangerous_command;
pub mod is_safe_command;
#[cfg(target_os = "windows")]
pub mod windows_safe_commands;