Skip to main content

validate_stream_file_name

Function validate_stream_file_name 

Source
pub fn validate_stream_file_name(field: &str, name: &str) -> ValidationResult
Expand description

fileName is ONE safe path segment.

Security-relevant, not cosmetic: kopia stores the --stdin-file value verbatim as the snapshot entry’s name and does not sanitize it, so an entry named ../x makes a later kopia restore <id> <dir> write OUTSIDE <dir> (verified against kopia 0.23.1). An empty value is worse still — kopia then ignores stdin entirely and tries to snapshot the source path from the mover’s own filesystem.