From 0d4cf625c4e7b954e83e2eec6f8a02294bcbdd86 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 5 Mar 2010 19:21:34 +0100 Subject: [PATCH] Create subroutines to add exclusion for plugins --- bacula/src/filed/filed.h | 7 +++---- bacula/src/filed/job.c | 31 +++++++++++++++++++------------ bacula/src/filed/protos.h | 10 ++++++++-- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/bacula/src/filed/filed.h b/bacula/src/filed/filed.h index 54905cbf44..6aac8f5218 100644 --- a/bacula/src/filed/filed.h +++ b/bacula/src/filed/filed.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2001-2008 Free Software Foundation Europe e.V. + Copyright (C) 2001-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -30,18 +30,17 @@ * * Kern Sibbald, Jan MMI * - * Version $Id$ */ /* * Number of acl errors to report per job. */ -#define ACL_REPORT_ERR_MAX_PER_JOB 25 +#define ACL_REPORT_ERR_MAX_PER_JOB 25 /* * Number of xattr errors to report per job. */ -#define XATTR_REPORT_ERR_MAX_PER_JOB 25 +#define XATTR_REPORT_ERR_MAX_PER_JOB 25 /* * Return codes from acl subroutines. diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 3616754f31..52ef73a648 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + Copyright (C) 2000-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -30,8 +30,6 @@ * * Kern Sibbald, October MM * - * Version $Id$ - * */ #include "bacula.h" @@ -664,8 +662,8 @@ static findFOPTS *start_options(FF_PKT *ff) * Add fname to include/exclude fileset list. First check for * | and < and if necessary perform command. */ -static void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *fileset, - bool is_file) +void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *fileset, + bool is_file) { char *p; BPIPE *bpipe; @@ -741,6 +739,21 @@ static void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *filese } } +findFILESET *new_exclude(JCR *jcr) +{ + FF_PKT *ff = jcr->ff; + findFILESET *fileset = ff->fileset; + + /* New exclude */ + fileset->incexe = (findINCEXE *)malloc(sizeof(findINCEXE)); + memset(fileset->incexe, 0, sizeof(findINCEXE)); + fileset->incexe->opts_list.init(1, true); + fileset->incexe->name_list.init(); + fileset->incexe->plugin_list.init(); + fileset->exclude_list.append(fileset->incexe); + return fileset; +} + static void add_fileset(JCR *jcr, const char *item) { @@ -791,13 +804,7 @@ static void add_fileset(JCR *jcr, const char *item) fileset->include_list.append(fileset->incexe); break; case 'E': - /* New exclude */ - fileset->incexe = (findINCEXE *)malloc(sizeof(findINCEXE)); - memset(fileset->incexe, 0, sizeof(findINCEXE)); - fileset->incexe->opts_list.init(1, true); - fileset->incexe->name_list.init(); - fileset->incexe->plugin_list.init(); - fileset->exclude_list.append(fileset->incexe); + fileset = new_exclude(jcr); break; case 'N': state = state_none; diff --git a/bacula/src/filed/protos.h b/bacula/src/filed/protos.h index 9ac0afbeeb..31cdfb3e00 100644 --- a/bacula/src/filed/protos.h +++ b/bacula/src/filed/protos.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + Copyright (C) 2000-2010 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -26,7 +26,8 @@ Switzerland, email:ftf@fsfeurope.org. */ /* - * Version $Id$ + * Written by Kern Sibbald, MM + * */ extern bool blast_data_to_storage_daemon(JCR *jcr, char *addr); @@ -64,3 +65,8 @@ void unstrip_path(FF_PKT *ff_pkt); /* from xattr.c */ bxattr_exit_code build_xattr_streams(JCR *jcr, FF_PKT *ff_pkt); bxattr_exit_code parse_xattr_streams(JCR *jcr, int stream); + +/* from job.c */ +findFILESET *new_exclude(JCR *jcr); +void add_file_to_fileset(JCR *jcr, const char *fname, findFILESET *fileset, + bool is_file); -- 2.39.5