Skip to main content

normalize_path

Function normalize_path 

Source
pub fn normalize_path(path: &Path) -> String
Expand description

Lexically normalize a path by resolving . and .. components without hitting the filesystem.

This prevents path traversal attacks where ../../etc/passwd could escape an allowed directory. Unlike std::fs::canonicalize, this does not require the path to exist and does not follow symlinks.