fix typo: confi{g}dir
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
1cb99c234e
commit
8fdef1a81c
@ -15,7 +15,7 @@ use crate::buildcfg;
|
|||||||
/// For security reasons, we want to make sure they are set correctly:
|
/// For security reasons, we want to make sure they are set correctly:
|
||||||
/// * owned by 'backup' user/group
|
/// * owned by 'backup' user/group
|
||||||
/// * nobody else can read (mode 0700)
|
/// * nobody else can read (mode 0700)
|
||||||
pub fn check_confidir_permissions() -> Result<(), Error> {
|
pub fn check_configdir_permissions() -> Result<(), Error> {
|
||||||
|
|
||||||
let cfgdir = buildcfg::CONFIGDIR;
|
let cfgdir = buildcfg::CONFIGDIR;
|
||||||
let (backup_uid, backup_gid) = tools::getpwnam_ugid("backup")?;
|
let (backup_uid, backup_gid) = tools::getpwnam_ugid("backup")?;
|
||||||
@ -48,7 +48,7 @@ pub fn create_configdir() -> Result<(), Error> {
|
|||||||
match nix::unistd::mkdir(cfgdir, Mode::from_bits_truncate(0o700)) {
|
match nix::unistd::mkdir(cfgdir, Mode::from_bits_truncate(0o700)) {
|
||||||
Ok(()) => {},
|
Ok(()) => {},
|
||||||
Err(nix::Error::Sys(nix::errno::Errno::EEXIST)) => {
|
Err(nix::Error::Sys(nix::errno::Errno::EEXIST)) => {
|
||||||
check_confidir_permissions()?;
|
check_configdir_permissions()?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
},
|
},
|
||||||
Err(err) => bail!("unable to create configuration directory '{}' - {}", cfgdir, err),
|
Err(err) => bail!("unable to create configuration directory '{}' - {}", cfgdir, err),
|
||||||
|
Loading…
Reference in New Issue
Block a user