Reject standalone absolute directory filter pattern /**/ during parsing

This commit is contained in:
Andrea Mazzoleni 2026-08-26 13:02:55 +02:00
parent 9e5f51fa5b
commit d4dc5a7339
5 changed files with 46 additions and 2 deletions

View file

@ -45,8 +45,8 @@ struct snapraid_filter* filter_alloc_file(int direction, const char* root, const
pathimport(filter->root, sizeof(filter->root), root);
filter->direction = direction;
/* reject the root directory as an invalid pattern */
if (pathcmp(filter->pattern, "/") == 0) {
/* reject the root directory and standalone absolute directory wildcard as invalid patterns */
if (pathcmp(filter->pattern, "/") == 0 || pathcmp(filter->pattern, "/**/") == 0) {
free(filter);
return 0;
}