Skip to main content

safe_canonicalize_in

Function safe_canonicalize_in 

pub async fn safe_canonicalize_in(
    root: impl AsRef<Path>,
    path: impl AsRef<Path>,
) -> Result<PathBuf, Error>
Available on crate feature std only.
Expand description

Canonicalize an existing path confined to within the trusted directory root.

path is treated as relative to root; absolute paths, .. traversal, reserved device names, smuggled prefixes, and symbolic links that resolve outside root are all rejected. root and path must exist.