]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix #1370 about the implementation of the "Exclude Dir Containing" option on FD.
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 9 Sep 2009 12:18:57 +0000 (14:18 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Wed, 9 Sep 2009 12:18:57 +0000 (14:18 +0200)
bacula/src/filed/job.c
bacula/src/findlib/find.c
bacula/src/findlib/find.h

index 4054b29f30438db510d97222b153ef92ee13d4de..549d6b704eec372c16af05d6b1ff19829c3e2709 100644 (file)
@@ -342,13 +342,13 @@ void *handle_client_request(void *dirp)
             fo->base.destroy();
             fo->fstype.destroy();
             fo->drivetype.destroy();
-            if (fo->ignoredir != NULL) {
-               free(fo->ignoredir);
-            }
          }
          incexe->opts_list.destroy();
          incexe->name_list.destroy();
          incexe->plugin_list.destroy();
+         if (incexe->ignoredir) {
+            free(incexe->ignoredir);
+         }
       }
       fileset->include_list.destroy();
 
@@ -371,6 +371,9 @@ void *handle_client_request(void *dirp)
          incexe->opts_list.destroy();
          incexe->name_list.destroy();
          incexe->plugin_list.destroy();
+         if (incexe->ignoredir) {
+            free(incexe->ignoredir);
+         }
       }
       fileset->exclude_list.destroy();
       free(fileset);
@@ -876,9 +879,8 @@ static void add_fileset(JCR *jcr, const char *item)
       state = state_options;
       break;
    case 'Z':
-      current_opts = start_options(ff);
-      current_opts->ignoredir = bstrdup(item);
-      state = state_options;
+      state = state_include;
+      fileset->incexe->ignoredir = bstrdup(item);
       break;
    case 'D':
       current_opts = start_options(ff);
@@ -941,9 +943,9 @@ static bool term_fileset(JCR *jcr)
          for (k=0; k<fo->drivetype.size(); k++) {
             Dmsg1(400, "XD %s\n", (char *)fo->drivetype.get(k));
          }
-         if (fo->ignoredir) {
-            Dmsg1(400, "Z %s\n", fo->ignoredir);
-         }
+      }
+      if (incexe->ignoredir) {
+         Dmsg1(400, "Z %s\n", incexe->ignoredir);
       }
       dlistString *node;
       foreach_dlist(node, &incexe->name_list) {
index 81e887a2925b00d617422f19d177f7ac1dfc81fb..d089b703a8cbe990048f2e18b7d2a2999bba4006 100644 (file)
@@ -274,11 +274,12 @@ static bool accept_file(FF_PKT *ff)
       basename = ff->fname;
    }
 
+   ff->ignoredir = incexe->ignoredir;
+
    for (j = 0; j < incexe->opts_list.size(); j++) {
       findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
       ff->flags = fo->flags;
       ff->GZIP_level = fo->GZIP_level;
-      ff->ignoredir = fo->ignoredir;
       ff->fstypes = fo->fstype;
       ff->drivetypes = fo->drivetype;
 
index 030aa3f3929d3861daf118b945faa37421377155..ff9be472eb277fc9f55cdf42a7ff3c450da34e51 100644 (file)
@@ -151,7 +151,6 @@ struct findFOPTS {
    alist base;                        /* list of base names */
    alist fstype;                      /* file system type limitation */
    alist drivetype;                   /* drive type limitation */
-   char *ignoredir;                   /* ignore directories with this file */
 };
 
 
@@ -161,6 +160,7 @@ struct findINCEXE {
    alist opts_list;                   /* options list */
    dlist name_list;                   /* filename list -- holds dlistString */
    dlist plugin_list;                 /* plugin list -- holds dlistString */
+   char *ignoredir;                   /* ignore directories with this file */
 };
 
 /*