From: Kern Sibbald Date: Sat, 6 Mar 2010 09:26:45 +0000 (+0100) Subject: Cread subroutines to add exclusion for plugins X-Git-Tag: Release-5.2.1~1645 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f509e18d54895e75e2abe0a0ac84b3445f7aa65a;p=bacula%2Fbacula Cread subroutines to add exclusion for plugins --- 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 b7671bf18e..28aa6d5a04 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -666,8 +666,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; @@ -743,6 +743,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) { @@ -793,13 +808,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);