Skip to main content

ensure_safe_relative_path

Function ensure_safe_relative_path 

Source
pub fn ensure_safe_relative_path(
    rel: &Path,
    label: &str,
    orig: &Path,
) -> Result<()>
Expand description

Validates that rel is a safe relative path. Returns an error mentioning label and orig if the path contains .., is absolute, or otherwise escapes the project root.