validate_binary_path

Function validate_binary_path 

Source
pub fn validate_binary_path(path: &Path) -> Result<PathBuf>
Expand description

Validate binary path with comprehensive security checks

Performs the following validations:

  1. File existence check
  2. Executable permissions check (Unix)
  3. Canonicalization (prevents path traversal)

ยงExamples

use cli_testing_specialist::utils::validate_binary_path;
use std::path::Path;

// Validate a system binary
let binary = validate_binary_path(Path::new("/usr/bin/ls"))?;
assert!(binary.is_absolute());