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

Reverts openai/codex#6577
This commit is contained in:
pakrym-oai
2025-11-13 08:43:00 -08:00
committed by GitHub
parent d28e912214
commit e6995174c1
11 changed files with 411 additions and 283 deletions
@@ -1,5 +1,4 @@
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
@@ -12,9 +11,12 @@ pub fn is_known_safe_command(command: &[String]) -> bool {
}
})
.collect();
if is_safe_command_windows(&command) {
return true;
#[cfg(target_os = "windows")]
{
use super::windows_safe_commands::is_safe_command_windows;
if is_safe_command_windows(&command) {
return true;
}
}
if is_safe_to_call_with_exec(&command) {
+1
View File
@@ -1,3 +1,4 @@
pub mod is_dangerous_command;
pub mod is_safe_command;
#[cfg(target_os = "windows")]
pub mod windows_safe_commands;