From: Eric Bollengier Date: Wed, 9 Sep 2009 12:21:24 +0000 (+0200) Subject: Add patch for #1370 X-Git-Tag: Release-7.0.0~2633^2~16^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=31e6e3d39390e6caa4c582ce37ad7e5036398f36;p=bacula%2Fbacula Add patch for #1370 --- diff --git a/bacula/patches/3.0.2-exclude-dir-containing-fd.patch b/bacula/patches/3.0.2-exclude-dir-containing-fd.patch new file mode 100644 index 0000000000..3e3a0ee2e3 --- /dev/null +++ b/bacula/patches/3.0.2-exclude-dir-containing-fd.patch @@ -0,0 +1,108 @@ +From 4d2f1c844510c9abb9ecf6f0283437862c4a3bfb Mon Sep 17 00:00:00 2001 +From: Eric Bollengier +Date: Wed, 9 Sep 2009 14:18:57 +0200 +Subject: [PATCH] Fix #1370 about the implementation of the "Exclude Dir Containing" option on FD. + +--- + bacula/src/filed/job.c | 20 +++++++++++--------- + bacula/src/findlib/find.c | 3 ++- + bacula/src/findlib/find.h | 2 +- + 3 files changed, 14 insertions(+), 11 deletions(-) + +diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c +index 4054b29..549d6b7 100644 +--- a/bacula/src/filed/job.c ++++ b/bacula/src/filed/job.c +@@ -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; kdrivetype.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) { +diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c +index 81e887a..d089b70 100644 +--- a/bacula/src/findlib/find.c ++++ b/bacula/src/findlib/find.c +@@ -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; + +diff --git a/bacula/src/findlib/find.h b/bacula/src/findlib/find.h +index 030aa3f..ff9be47 100644 +--- a/bacula/src/findlib/find.h ++++ b/bacula/src/findlib/find.h +@@ -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 */ + }; + + /* +-- +1.6.3.1 +