From 05e91dcecdb66471d8b9ebb7f649194bd6eb9b87 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 17 Dec 2004 09:27:01 +0000 Subject: [PATCH] - Apply Preben 'Peppe' Guldberg alist fix patch. - Remove duplicate code from chksum.h (mentioned by Preben). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1762 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/filed/chksum.h | 58 ----------------------------------- bacula/src/findlib/find.c | 4 +-- bacula/src/findlib/find.h | 4 +-- bacula/src/findlib/find_one.c | 8 ++--- bacula/src/version.h | 4 +-- 5 files changed, 10 insertions(+), 68 deletions(-) diff --git a/bacula/src/filed/chksum.h b/bacula/src/filed/chksum.h index 125edce567..7d0d45bf1a 100644 --- a/bacula/src/filed/chksum.h +++ b/bacula/src/filed/chksum.h @@ -2,64 +2,6 @@ * General routines for handling the various checksum supported. */ -/* - Copyright (C) 2000-2004 Kern Sibbald and John Walker - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. - - */ - -#ifndef _CHKSUM_H_ -#define _CHKSUM_H_ - -#include "bacula.h" - -/* - * Link these to findlib options. Doing so allows for simpler handling of - * signatures in the callers. - * If multiple signatures are specified, the order in chksum_init() matters. - * Still, spell out our own names in case we want to change the approach. - */ -#define CHKSUM_NONE 0 -#define CHKSUM_MD5 FO_MD5 -#define CHKSUM_SHA1 FO_SHA1 - -union chksumContext { - MD5Context md5; - SHA1Context sha1; -}; - -struct CHKSUM { - int type; /* One of CHKSUM_* above */ - char name[5]; /* Big enough for NONE, MD5, SHA1, etc. */ - bool updated; /* True if updated by chksum_update() */ - chksumContext context; /* Context for the algorithm at hand */ - int length; /* Length of signature */ - unsigned char signature[30]; /* Large enough for either signature */ -}; - -int chksum_init(CHKSUM *chksum, int flags); -int chksum_update(CHKSUM *chksum, void *buf, unsigned len); -int chksum_final(CHKSUM *chksum); - -#endif -/* - * General routines for handling the various checksum supported. - */ - /* Copyright (C) 2004 Kern Sibbald diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c index 8a5d3015da..2b587e25e4 100644 --- a/bacula/src/findlib/find.c +++ b/bacula/src/findlib/find.c @@ -136,7 +136,7 @@ find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void findFOPTS *fo = (findFOPTS *)incexe->opts_list.get(j); ff->flags |= fo->flags; ff->GZIP_level = fo->GZIP_level; - ff->fstypes = &(fo->fstype); + ff->fstypes = fo->fstype; bstrncat(ff->VerifyOpts, fo->VerifyOpts, sizeof(ff->VerifyOpts)); } for (j=0; jname_list.size(); j++) { @@ -178,7 +178,7 @@ static bool accept_file(FF_PKT *ff) ff->GZIP_level = fo->GZIP_level; ff->reader = fo->reader; ff->writer = fo->writer; - ff->fstypes = &(fo->fstype); + ff->fstypes = fo->fstype; ic = (ff->flags & FO_IGNORECASE) ? FNM_CASEFOLD : 0; for (k=0; kwild.size(); k++) { if (fnmatch((char *)fo->wild.get(k), ff->fname, fnmode|ic) == 0) { diff --git a/bacula/src/findlib/find.h b/bacula/src/findlib/find.h index ba29809654..0b62f0da37 100755 --- a/bacula/src/findlib/find.h +++ b/bacula/src/findlib/find.h @@ -4,7 +4,7 @@ * Kern Sibbald MIM */ /* - Copyright (C) 2000-2004 Kern Sibbald and John Walker + Copyright (C) 2000-2004 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -197,7 +197,7 @@ struct FF_PKT { int GZIP_level; /* compression level */ char *reader; /* reader program */ char *writer; /* writer program */ - alist *fstypes; /* allowed file system types */ + alist fstypes; /* allowed file system types */ /* List of all hard linked files found */ struct f_link *linklist; /* hard linked files */ diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 67aa836890..2cce54fa10 100755 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -69,20 +69,20 @@ static int accept_fstype(FF_PKT *ff, void *dummy) { char *fs; bool accept = true; - if (ff->fstypes->size()) { + if (ff->fstypes.size()) { accept = false; fs = fstype(ff->fname); if (fs == NULL) { Dmsg1(50, "Cannot determine file system type for \"%s\"\n", ff->fname); } else { - for (i = 0; i < ff->fstypes->size(); ++i) { - if (strcmp(fs, (char *)ff->fstypes->get(i)) == 0) { + for (i = 0; i < ff->fstypes.size(); ++i) { + if (strcmp(fs, (char *)ff->fstypes.get(i)) == 0) { Dmsg2(100, "Accepting fstype %s for \"%s\"\n", fs, ff->fname); accept = true; break; } Dmsg3(200, "fstype %s for \"%s\" does not match %s\n", fs, - ff->fname, ff->fstypes->get(i)); + ff->fname, ff->fstypes.get(i)); } free(fs); } diff --git a/bacula/src/version.h b/bacula/src/version.h index 5ab0248cc0..10a0c89b5e 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #undef VERSION #define VERSION "1.37.1" -#define BDATE "12 December 2004" -#define LSMDATE "12Dec04" +#define BDATE "17 December 2004" +#define LSMDATE "17Dec04" /* Debug flags */ #undef DEBUG -- 2.39.5