1 From 4d2f1c844510c9abb9ecf6f0283437862c4a3bfb Mon Sep 17 00:00:00 2001
2 From: Eric Bollengier <eric@eb.homelinux.org>
3 Date: Wed, 9 Sep 2009 14:18:57 +0200
4 Subject: [PATCH] Fix #1370 about the implementation of the "Exclude Dir Containing" option on FD.
7 bacula/src/filed/job.c | 20 +++++++++++---------
8 bacula/src/findlib/find.c | 3 ++-
9 bacula/src/findlib/find.h | 2 +-
10 3 files changed, 14 insertions(+), 11 deletions(-)
12 diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c
13 index 4054b29..549d6b7 100644
14 --- a/bacula/src/filed/job.c
15 +++ b/bacula/src/filed/job.c
16 @@ -342,13 +342,13 @@ void *handle_client_request(void *dirp)
19 fo->drivetype.destroy();
20 - if (fo->ignoredir != NULL) {
21 - free(fo->ignoredir);
24 incexe->opts_list.destroy();
25 incexe->name_list.destroy();
26 incexe->plugin_list.destroy();
27 + if (incexe->ignoredir) {
28 + free(incexe->ignoredir);
31 fileset->include_list.destroy();
33 @@ -371,6 +371,9 @@ void *handle_client_request(void *dirp)
34 incexe->opts_list.destroy();
35 incexe->name_list.destroy();
36 incexe->plugin_list.destroy();
37 + if (incexe->ignoredir) {
38 + free(incexe->ignoredir);
41 fileset->exclude_list.destroy();
43 @@ -876,9 +879,8 @@ static void add_fileset(JCR *jcr, const char *item)
44 state = state_options;
47 - current_opts = start_options(ff);
48 - current_opts->ignoredir = bstrdup(item);
49 - state = state_options;
50 + state = state_include;
51 + fileset->incexe->ignoredir = bstrdup(item);
54 current_opts = start_options(ff);
55 @@ -941,9 +943,9 @@ static bool term_fileset(JCR *jcr)
56 for (k=0; k<fo->drivetype.size(); k++) {
57 Dmsg1(400, "XD %s\n", (char *)fo->drivetype.get(k));
59 - if (fo->ignoredir) {
60 - Dmsg1(400, "Z %s\n", fo->ignoredir);
63 + if (incexe->ignoredir) {
64 + Dmsg1(400, "Z %s\n", incexe->ignoredir);
67 foreach_dlist(node, &incexe->name_list) {
68 diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c
69 index 81e887a..d089b70 100644
70 --- a/bacula/src/findlib/find.c
71 +++ b/bacula/src/findlib/find.c
72 @@ -274,11 +274,12 @@ static bool accept_file(FF_PKT *ff)
76 + ff->ignoredir = incexe->ignoredir;
78 for (j = 0; j < incexe->opts_list.size(); j++) {
79 findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j);
80 ff->flags = fo->flags;
81 ff->GZIP_level = fo->GZIP_level;
82 - ff->ignoredir = fo->ignoredir;
83 ff->fstypes = fo->fstype;
84 ff->drivetypes = fo->drivetype;
86 diff --git a/bacula/src/findlib/find.h b/bacula/src/findlib/find.h
87 index 030aa3f..ff9be47 100644
88 --- a/bacula/src/findlib/find.h
89 +++ b/bacula/src/findlib/find.h
90 @@ -151,7 +151,6 @@ struct findFOPTS {
91 alist base; /* list of base names */
92 alist fstype; /* file system type limitation */
93 alist drivetype; /* drive type limitation */
94 - char *ignoredir; /* ignore directories with this file */
98 @@ -161,6 +160,7 @@ struct findINCEXE {
99 alist opts_list; /* options list */
100 dlist name_list; /* filename list -- holds dlistString */
101 dlist plugin_list; /* plugin list -- holds dlistString */
102 + char *ignoredir; /* ignore directories with this file */