Skip to main content

assert_contained

Function assert_contained 

Source
pub fn assert_contained(parent: &Path, candidate: &Path) -> Result<PathBuf>
Expand description

Assert candidate resolves inside parent; returns the cleaned candidate. Prevents path traversal via .. or absolute paths in user-controlled inputs.