Compare commits

...

5 Commits

Author SHA1 Message Date
rreichel3-oai
58ff30ef1e Trailing space removal 2025-12-22 12:45:06 -05:00
rreichel3-oai
c16de5e36a remove trailing space 2025-12-22 12:38:57 -05:00
rreichel3-oai
91d03f29d1 Fix Formatting
Fix
2025-12-22 11:20:20 -05:00
rreichel3-oai
9fdd2e00f1 Update is_dangerous_command.rs 2025-12-15 14:57:28 -05:00
rreichel3-oai
e6c3ded753 Update is_dangerous_command.rs 2025-12-15 14:30:36 -05:00

View File

@@ -67,10 +67,16 @@ fn is_dangerous_to_call_with_exec(command: &[String]) -> bool {
match cmd0 {
Some(cmd) if cmd.ends_with("git") || cmd.ends_with("/git") => {
matches!(command.get(1).map(String::as_str), Some("reset" | "rm"))
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")),
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..]),