]> git.proxmox.com Git - proxmox-backup.git/commitdiff
proxmox-rrd: use create_path instead of std::fs::create_dir_all
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 6 Oct 2021 06:37:14 +0000 (08:37 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 6 Oct 2021 06:37:14 +0000 (08:37 +0200)
To ensure correct file ownership.

proxmox-rrd/src/cache.rs

index c87e49fd276d9859ba8846ef794a278aa6925266..c0e46d35b89fa018967f779a93e21b96760e39cb 100644 (file)
@@ -37,9 +37,6 @@ impl RRDCache {
             cache: RwLock::new(HashMap::new()),
         }
     }
-}
-
-impl RRDCache {
 
     /// Create rrdd stat dir with correct permission
     pub fn create_rrdb_dir(&self) -> Result<(), Error> {
@@ -62,7 +59,7 @@ impl RRDCache {
         let mut path = self.basedir.clone();
         path.push(rel_path);
 
-        std::fs::create_dir_all(path.parent().unwrap())?; // fixme??
+        create_path(path.parent().unwrap(), Some(self.dir_options.clone()), Some(self.file_options.clone()))?;
 
         let mut map = self.cache.write().unwrap();
         let now = proxmox::tools::time::epoch_f64();
@@ -107,5 +104,4 @@ impl RRDCache {
             None => None,
         }
     }
-
 }