create_secrets_dir

Function create_secrets_dir 

Source
pub(crate) fn create_secrets_dir(system_user: &User) -> Result<(), Error>
Expand description

Creates the secrets directory for a [User].

Creates the secrets directory for the user and ensures correct ownership of it and all parent directories up until the user’s home directory.

§Note

Relies on [get_user_secrets_dir] to retrieve the secrets dir for the system_user.

§Errors

Returns an error if

  • the effective user ID of the calling process is not that of root,
  • the directory or one of its parents could not be created,
  • the ownership of any directory between the user’s home and the secrets directory can not be changed