Skip to main content

check_component

Function check_component 

Source
pub fn check_component(component: &str) -> Result<(), &'static str>
Expand description

Whether one path component is acceptable as-is.

Applied on every platform, not just Windows. A tree written on Linux and read on Windows would otherwise contain names the other side cannot open, and a jail that behaves differently per host is not a jail anyone can reason about.

.. is not rejected here — escape is decided by canonicalisation (FsRoot::resolve_existing), and a substring rule would also reject the perfectly ordinary my..file.txt.