frontmatter_gen::utils::fs

Function validate_path_safety

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

Validates that a path is safe to use

§Arguments

  • path - Path to validate

§Returns

Returns Ok(()) if the path is safe, or an error if validation fails

§Security

Checks for:

  • Path length limits
  • Invalid characters
  • Path traversal attempts
  • Symlinks
  • Reserved names