]> git.ipfire.org Git - pakfire.git/commitdiff
snapshots: Only consider directories or symlinks
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 18:27:46 +0000 (18:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 11 Jan 2025 18:27:46 +0000 (18:27 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/snapshot.c

index 5b1b4014fa31f53d2f0231e5e97d24b3c9eec716..a09c71548460c7a4ade479669bf24a460b4416ad 100644 (file)
@@ -162,6 +162,17 @@ static int pakfire_snapshot_filter(const struct dirent* dirent) {
        time_t now;
        int r;
 
+       // Only consider directories or symlinks
+       switch (dirent->d_type) {
+               case DT_DIR:
+               case DT_LNK:
+                       break;
+
+               // Ignore the rest
+               default:
+                       return 0;
+       }
+
        // Skip any hidden directories
        if (*dirent->d_name == '.')
                return 0;