From e2fa21c8f90677a59c198372644b52e879a61eec Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 11 Jan 2025 18:27:46 +0000 Subject: [PATCH] snapshots: Only consider directories or symlinks Signed-off-by: Michael Tremer --- src/pakfire/snapshot.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pakfire/snapshot.c b/src/pakfire/snapshot.c index 5b1b4014f..a09c71548 100644 --- a/src/pakfire/snapshot.c +++ b/src/pakfire/snapshot.c @@ -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; -- 2.47.3