Skip to main content

ensure_safe_dir

Function ensure_safe_dir 

Source
pub fn ensure_safe_dir(dir: &Path, uid: u32) -> bool
Expand description

Ensure dir is a 0700 directory owned by uid, creating it atomically at that mode when absent. Returns false if it exists as a symlink or as another user’s directory, which are never chmod’d through; a real directory we own but with loose permissions is tightened in place.