validate_path_security

Function validate_path_security 

Source
pub fn validate_path_security(path: &Path, check_symlinks: bool) -> Result<()>
Expand description

Validates a path for security constraints

Checks if the path:

  • Is not blacklisted
  • Does not contain symlinks (if check_symlinks is true)

§Arguments

  • path - The path to validate (should be the original path before canonicalization)
  • check_symlinks - Whether to check for symlinks in the path

§Returns

  • Ok(()) if the path is safe
  • Err with a descriptive error message if the path fails validation