INNER CODE UNIT · Rust
Some
ovexro/dockpanel · panel/backend/src/routes/mod.rs:272
while let Some(c) = chars.next() {
match c {
'\'' | '"' => {}
'\\' => {
if let Some(next) = chars.next() {
out.push(next);
}
}
_ => out.push(c),
}
}
out
}
/// Validate a shell command string for safety (used for cron, pre_build, post_deploy).
/// Rejects dangerous shell metacharacters and patterns while allowing legitimate commands.
pub fn is_safe_shell_command(cmd: &str) -> Result<(), &'static str> {
if cmd.trim().is_empty() {