pub fn validate_command(command: &str) -> Result<String, String>Expand description
Validate command to prevent dangerous operations and command injection
§Checks
- Rejects known dangerous commands from DANGEROUS_COMMANDS list
- Rejects piping to bash/sh shells
- Rejects command substitution attempts (
$(...)or backticks) - Rejects command chaining (
&&) - Rejects
evalcommand
§Arguments
command- The command string to validate
§Returns
Ok(command)- The validated command if all checks passErr(reason)- A string describing why the command was rejected