Skip to main content

sanitize_relative_path

Function sanitize_relative_path 

Source
pub fn sanitize_relative_path(name: &str) -> Result<PathBuf, WorkflowError>
Expand description

Sanitizes a ‘/’-separated path from decrypted metadata into a relative path that cannot escape the output directory: rejects .. components, backslashes, and (on Windows) drive prefixes and : stream separators, drops empty and . components (which also relativizes absolute paths). The decrypted name is deliberately not echoed into error messages.