pub fn create_private_dir(path: &Path) -> Result<(), String>Expand description
Create a directory only its owner can enter, failing if the path already exists.
create_dir_all followed by chmod leaves a window in which the directory is
world-readable, and accepts a path an attacker pre-created in a shared temp directory
(including a symlink to somewhere they control). This creates the final component with
mode 0700 in one step and refuses an existing one. The parent must already exist.
On Windows the directory gets a protected owner-only access list that its contents inherit.