fix directory permission problems

By carefully setting options on all create_path() calls,
and by creating "/var/lib/proxmox-backup" at api server startup.
This commit is contained in:
Dietmar Maurer
2021-11-12 07:29:18 +01:00
parent efd4ddc17b
commit b935209584
6 changed files with 48 additions and 10 deletions

View File

@ -62,3 +62,12 @@ pub fn create_run_dir() -> Result<(), Error> {
let _: bool = create_path(pbs_buildcfg::PROXMOX_BACKUP_RUN_DIR_M!(), None, Some(opts))?;
Ok(())
}
pub fn create_state_dir() -> Result<(), Error> {
let backup_user = pbs_config::backup_user()?;
let opts = CreateOptions::new()
.owner(backup_user.uid)
.group(backup_user.gid);
create_path(pbs_buildcfg::PROXMOX_BACKUP_STATE_DIR_M!(), None, Some(opts))?;
Ok(())
}