mirror of
https://github.com/openai/codex.git
synced 2026-09-17 12:23:33 +00:00
Update is_dangerous_command.rs
This commit is contained in:
@@ -70,7 +70,7 @@ fn is_dangerous_to_call_with_exec(command: &[String]) -> bool {
|
||||
matches!(command.get(1).map(String::as_str), Some("reset" | "rm" | "--force" ))
|
||||
}
|
||||
|
||||
Some("rm") => matches!(command.get(1).map(String::as_str), Some("-f" | "-rf" | "-Rf" | "-fr" | "-fR" | "--force" | )),
|
||||
Some("rm") => matches!(command.get(1).map(String::as_str), Some("-f" | "-rf" | "-Rf" | "-fr" | "-fR" | "--force" )),
|
||||
|
||||
// for sudo <cmd> simply do the check for <cmd>
|
||||
Some("sudo") => is_dangerous_to_call_with_exec(&command[1..]),
|
||||
|
||||
Reference in New Issue
Block a user