Skip to main content

ensure_owner_only_dir

Function ensure_owner_only_dir 

Source
pub fn ensure_owner_only_dir(dir: &Path) -> Result<OwnerOnlyOutcome>
Expand description

Make dir owner-only on Unix: create it 0700 if missing (its parents with the normal umask — they are the user’s, not AgentMux’s), or strip group/other bits from an existing directory, keeping the owner bits as they were. See DataPaths::ensure_dirs for why (#3682).

Follows a symlinked root to its target, as every other access to the root already does. Errors if dir exists but is not a directory.