]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix #1369 about segfault when using ExcludeDirContaining before defining Options...
authorEric Bollengier <eric@eb.homelinux.org>
Wed, 9 Sep 2009 08:24:20 +0000 (10:24 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 10 Sep 2009 12:48:20 +0000 (14:48 +0200)
bacula/src/dird/dird_conf.c
bacula/src/dird/dird_conf.h
bacula/src/dird/fd_cmds.c
bacula/src/dird/inc_conf.c

index 7a3f44603030a7a8987b19a32fba28f4b69a0f12..ff52f4109b9c52dece3f84e92c2325c10f199fb4 100644 (file)
@@ -806,6 +806,9 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
             }
             sendit(sock, "      N\n");
          }
+         if (incexe->ignoredir) {
+            sendit(sock, "      Z %s\n", incexe->ignoredir);
+         }
          for (j=0; j<incexe->name_list.size(); j++) {
             sendit(sock, "      I %s\n", incexe->name_list.get(j));
          }
@@ -1026,6 +1029,9 @@ static void free_incexe(INCEXE *incexe)
    if (incexe->opts_list) {
       free(incexe->opts_list);
    }
+   if (incexe->ignoredir) {
+      free(incexe->ignoredir);
+   }
    free(incexe);
 }
 
index 231dfabe5d6ab084ed7ae04d1863cb87b48de1ac..55706ec6c4d0f38e6d24e6c75935301f9360f8c3 100644 (file)
@@ -462,7 +462,6 @@ struct FOPTS {
    alist drivetype;                   /* drive type limitation */
    char *reader;                      /* reader program */
    char *writer;                      /* writer program */
-   char *ignoredir;                   /* ignoredir string */
    char *plugin;                      /* plugin program */
 };
 
@@ -474,6 +473,7 @@ struct INCEXE {
    int32_t num_opts;                  /* number of options items */
    alist name_list;                   /* filename list -- holds char * */
    alist plugin_list;                 /* filename list for plugins */
+   char *ignoredir;                   /* ignoredir string */
 };
 
 /*
index b24cff0eaeb84ff79630f026c25f92a30c215a69..f9eda5924fe562a6b8b88791b1d60424cd2abb44 100644 (file)
@@ -354,6 +354,9 @@ static bool send_fileset(JCR *jcr)
             ie = fileset->exclude_items[i];
             fd->fsend("E\n");
          }
+         if (ie->ignoredir) {
+            bnet_fsend(fd, "Z %s\n", ie->ignoredir);
+         }
          for (j=0; j<ie->num_opts; j++) {
             FOPTS *fo = ie->opts_list[j];
             fd->fsend("O %s\n", fo->opts);
@@ -399,9 +402,6 @@ static bool send_fileset(JCR *jcr)
             if (fo->plugin) {
                fd->fsend("G %s\n", fo->plugin);
             }
-            if (fo->ignoredir) {
-               bnet_fsend(fd, "Z %s\n", fo->ignoredir);
-            }
             if (fo->reader) {
                fd->fsend("D %s\n", fo->reader);
             }
index ef15d3f2dd0a6e056e22e9a8af32b2fd773e612e..aedde440b4b6f399c4b6c03efabc5bfc893137e9 100644 (file)
@@ -588,7 +588,7 @@ static void store_excludedir(LEX *lc, RES_ITEM2 *item, int index, int pass, bool
    }
    token = lex_get_token(lc, T_NAME);
    if (pass == 1) {
-      res_incexe.current_opts->ignoredir = bstrdup(lc->str);
+      res_incexe.ignoredir = bstrdup(lc->str);
    }
    scan_to_eol(lc);
 }