[pbs-devel] [RFC proxmox-backup 1/4] datastore: always skip over base directory when listing index files

Christian Ebner c.ebner at proxmox.com
Wed Apr 16 16:18:00 CEST 2025


The base is a directory and not an index file anyways, so there is no
need to apply the filtering and archive type matching on it.
Further, this will allow to use a hidden folder as base, otherwise
not possible as excluded by the filtering, which will be useful when
listing index files in a `.trash` folder.

No functional change intended.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 pbs-datastore/src/datastore.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index 309137e00..3fde8b871 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -979,7 +979,9 @@ impl DataStore {
 
         use walkdir::WalkDir;
 
-        let walker = WalkDir::new(base).into_iter();
+        let mut walker = WalkDir::new(base).into_iter();
+        // always ignore the base directory itself, so a hidden folder can be used as base as well
+        walker.next();
 
         // make sure we skip .chunks (and other hidden files to keep it simple)
         fn is_hidden(entry: &walkdir::DirEntry) -> bool {
-- 
2.39.5





More information about the pbs-devel mailing list