From 6724ed71600d262d79fc75cc47b3692be125db56 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 26 Aug 2026 12:53:43 +0200 Subject: [PATCH] Ensure .snapraidignore rules are loaded when nohidden is enabled --- cmdline/scan.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmdline/scan.c b/cmdline/scan.c index ab17ae03..ec159b08 100644 --- a/cmdline/scan.c +++ b/cmdline/scan.c @@ -1409,10 +1409,17 @@ static int scan_sub(struct snapraid_scan* scan, int level, int is_diff, char* pa /* LCOV_EXCL_STOP */ } - /* exclude hidden files even before calling lstat() */ + /* + * Exclude hidden files even before calling lstat(). + * Note that .snapraidignore is an exception because it is a control file + * that defines local exclusion rules, and must also be preserved as array + * data so that exclusion rules survive disaster recovery. + */ if (filter_hidden(state->filter_hidden, dd) != 0) { - msg_verbose("Excluding hidden '%s'\n", path_next); - continue; + if (strcmp(".snapraidignore", dd->d_name) != 0) { + msg_verbose("Excluding hidden '%s'\n", path_next); + continue; + } } /* exclude content files even before calling lstat() */