]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/findlib/find.c
Add regex to FileSet + fix ACL crash + gnome1 Makefile + 30 second retry for DB
[bacula/bacula] / bacula / src / findlib / find.c
index b74f90c2d4561a793343996b29273c708b4d9ab5..f3d4ef93190a26dda469b8ed09bdc34073a3c168 100644 (file)
@@ -28,7 +28,6 @@
 #include "bacula.h"
 #include "find.h"
 
-
 int32_t name_max;             /* filename max length */
 int32_t path_max;             /* path name max length */
 
@@ -170,6 +169,18 @@ static bool accept_file(FF_PKT *ff)
            return true;              /* accept file */
         }
       }
+      for (k=0; k<fo->regex.size(); k++) {
+        const int nmatch = 30;
+        regmatch_t pmatch[nmatch];
+        if (regexec((regex_t *)fo->regex.get(k), ff->fname, nmatch, pmatch,  0) == 0) {
+           ff->flags = fo->flags;
+           ff->GZIP_level = fo->GZIP_level;
+           if (ff->flags & FO_EXCLUDE) {
+              return false;          /* reject file */
+           }
+           return true;              /* accept file */
+        }
+      }
    }
 
    for (i=0; i<fileset->exclude_list.size(); i++) {