From: Kern Sibbald Date: Fri, 24 Dec 2004 10:23:54 +0000 (+0000) Subject: Fix the seg fault at the end of a job in the FD when using X-Git-Tag: Release-7.0.0~9012 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=720cafdc929965f6ce04aa57f776d918048bf5eb;p=bacula%2Fbacula Fix the seg fault at the end of a job in the FD when using old style include/excludes. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1779 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/1.36.1-fileset.patch b/bacula/patches/1.36.1-fileset.patch new file mode 100644 index 0000000000..99104c13ee --- /dev/null +++ b/bacula/patches/1.36.1-fileset.patch @@ -0,0 +1,160 @@ + + This patch should correct a seg fault in the FD that occurs + at the end of a job when the job uses old style include/excludes. + Apply the patch to version 1.36.1 with: + + cd + patch -p0 <1.36.1-fileset.patch + make + make install + ... + +Index: src/findlib/match.c +=================================================================== +RCS file: /cvsroot/bacula/bacula/src/findlib/match.c,v +retrieving revision 1.21 +diff -u -r1.21 match.c +--- src/findlib/match.c 21 Dec 2004 16:18:37 -0000 1.21 ++++ src/findlib/match.c 24 Dec 2004 10:17:29 -0000 +@@ -10,7 +10,7 @@ + * + */ + /* +- Copyright (C) 2001-2004 Kern Sibbald and John Walker ++ Copyright (C) 2001-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 +@@ -74,19 +74,21 @@ + free(inc); + inc = next_inc; + } ++ ff->included_files_list = NULL; + + for (exc=ff->excluded_files_list; exc; ) { + next_exc = exc->next; + free(exc); + exc = next_exc; + } ++ ff->excluded_files_list = NULL; + + for (exc=ff->excluded_paths_list; exc; ) { + next_exc = exc->next; + free(exc); + exc = next_exc; + } +- ++ ff->excluded_paths_list = NULL; + } + + /* +@@ -111,42 +113,42 @@ + if (prefixed) { + for (rp=fname; *rp && *rp != ' '; rp++) { + switch (*rp) { +- case 'a': /* alway replace */ +- case '0': /* no option */ ++ case 'a': /* alway replace */ ++ case '0': /* no option */ + break; +- case 'f': ++ case 'f': + inc->options |= FO_MULTIFS; + break; +- case 'h': /* no recursion */ ++ case 'h': /* no recursion */ + inc->options |= FO_NO_RECURSION; + break; +- case 'M': /* MD5 */ ++ case 'M': /* MD5 */ + inc->options |= FO_MD5; + break; +- case 'n': ++ case 'n': + inc->options |= FO_NOREPLACE; + break; +- case 'p': /* use portable data format */ ++ case 'p': /* use portable data format */ + inc->options |= FO_PORTABLE; + break; +- case 'r': /* read fifo */ ++ case 'r': /* read fifo */ + inc->options |= FO_READFIFO; + break; +- case 'S': ++ case 'S': + inc->options |= FO_SHA1; + break; +- case 's': ++ case 's': + inc->options |= FO_SPARSE; + break; +- case 'm': ++ case 'm': + inc->options |= FO_MTIMEONLY; + break; +- case 'k': ++ case 'k': + inc->options |= FO_KEEPATIME; + break; +- case 'V': /* verify options */ ++ case 'V': /* verify options */ + /* Copy Verify Options */ +- for (j=0; *rp && *rp != ':'; rp++) { ++ for (j=0; *rp && *rp != ':'; rp++) { + inc->VerifyOpts[j] = *rp; + if (j < (int)sizeof(inc->VerifyOpts) - 1) { + j++; +@@ -154,19 +156,19 @@ + } + inc->VerifyOpts[j] = 0; + break; +- case 'w': ++ case 'w': + inc->options |= FO_IF_NEWER; + break; +- case 'A': ++ case 'A': + inc->options |= FO_ACL; + break; +- case 'Z': /* gzip compression */ ++ case 'Z': /* gzip compression */ + inc->options |= FO_GZIP; +- inc->level = *++rp - '0'; +- Dmsg1(200, "Compression level=%d\n", inc->level); ++ inc->level = *++rp - '0'; ++ Dmsg1(200, "Compression level=%d\n", inc->level); + break; + default: +- Emsg1(M_ERROR, 0, "Unknown include/exclude option: %c\n", *rp); ++ Emsg1(M_ERROR, 0, "Unknown include/exclude option: %c\n", *rp); + break; + } + } +@@ -199,7 +201,7 @@ + /* Convert any \'s into /'s */ + for (p=inc->fname; *p; p++) { + if (*p == '\\') { +- *p = '/'; ++ *p = '/'; + } + } + #endif +@@ -249,7 +251,7 @@ + /* Convert any \'s into /'s */ + for (char *p=exc->fname; *p; p++) { + if (*p == '\\') { +- *p = '/'; ++ *p = '/'; + } + } + #endif +@@ -329,7 +331,7 @@ + } + for ( ; exc; exc=exc->next ) { + if (fnmatch(exc->fname, file, fnmode|FNM_PATHNAME) == 0) { +- Dmsg2(900, "Match exc pat=%s: file=%s:\n", exc->fname, file); ++ Dmsg2(900, "Match exc pat=%s: file=%s:\n", exc->fname, file); + return 1; + } + Dmsg2(900, "No match exc pat=%s: file=%s:\n", exc->fname, file); diff --git a/bacula/patches/patches-1.36.1 b/bacula/patches/patches-1.36.1 index 23bfed574f..2017753112 100644 --- a/bacula/patches/patches-1.36.1 +++ b/bacula/patches/patches-1.36.1 @@ -22,3 +22,7 @@ 21Dec04 1.36.1-reload.patch This patch fixes Bacula so that it does not exit if there is a syntax error in its conf file during a reload command. + +24Dec04 1.36.1-fileset.patch + This patch should correct a seg fault in the FD that occurs + at the end of a job when the job uses old style include/excludes. diff --git a/bacula/src/findlib/match.c b/bacula/src/findlib/match.c index fe84276b3c..b83653f8f9 100644 --- a/bacula/src/findlib/match.c +++ b/bacula/src/findlib/match.c @@ -10,7 +10,7 @@ * */ /* - Copyright (C) 2001-2004 Kern Sibbald and John Walker + Copyright (C) 2001-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 @@ -74,19 +74,21 @@ void term_include_exclude_files(FF_PKT *ff) free(inc); inc = next_inc; } + ff->included_files_list = NULL; for (exc=ff->excluded_files_list; exc; ) { next_exc = exc->next; free(exc); exc = next_exc; } + ff->excluded_files_list = NULL; for (exc=ff->excluded_paths_list; exc; ) { next_exc = exc->next; free(exc); exc = next_exc; } - + ff->excluded_paths_list = NULL; } /* @@ -111,42 +113,42 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname) if (prefixed) { for (rp=fname; *rp && *rp != ' '; rp++) { switch (*rp) { - case 'a': /* alway replace */ - case '0': /* no option */ + case 'a': /* alway replace */ + case '0': /* no option */ break; - case 'f': + case 'f': inc->options |= FO_MULTIFS; break; - case 'h': /* no recursion */ + case 'h': /* no recursion */ inc->options |= FO_NO_RECURSION; break; - case 'M': /* MD5 */ + case 'M': /* MD5 */ inc->options |= FO_MD5; break; - case 'n': + case 'n': inc->options |= FO_NOREPLACE; break; - case 'p': /* use portable data format */ + case 'p': /* use portable data format */ inc->options |= FO_PORTABLE; break; - case 'r': /* read fifo */ + case 'r': /* read fifo */ inc->options |= FO_READFIFO; break; - case 'S': + case 'S': inc->options |= FO_SHA1; break; - case 's': + case 's': inc->options |= FO_SPARSE; break; - case 'm': + case 'm': inc->options |= FO_MTIMEONLY; break; - case 'k': + case 'k': inc->options |= FO_KEEPATIME; break; - case 'V': /* verify options */ + case 'V': /* verify options */ /* Copy Verify Options */ - for (j=0; *rp && *rp != ':'; rp++) { + for (j=0; *rp && *rp != ':'; rp++) { inc->VerifyOpts[j] = *rp; if (j < (int)sizeof(inc->VerifyOpts) - 1) { j++; @@ -154,19 +156,19 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname) } inc->VerifyOpts[j] = 0; break; - case 'w': + case 'w': inc->options |= FO_IF_NEWER; break; - case 'A': + case 'A': inc->options |= FO_ACL; break; - case 'Z': /* gzip compression */ + case 'Z': /* gzip compression */ inc->options |= FO_GZIP; - inc->level = *++rp - '0'; - Dmsg1(200, "Compression level=%d\n", inc->level); + inc->level = *++rp - '0'; + Dmsg1(200, "Compression level=%d\n", inc->level); break; default: - Emsg1(M_ERROR, 0, "Unknown include/exclude option: %c\n", *rp); + Emsg1(M_ERROR, 0, "Unknown include/exclude option: %c\n", *rp); break; } } @@ -199,7 +201,7 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname) /* Convert any \'s into /'s */ for (p=inc->fname; *p; p++) { if (*p == '\\') { - *p = '/'; + *p = '/'; } } #endif @@ -249,7 +251,7 @@ void add_fname_to_exclude_list(FF_PKT *ff, const char *fname) /* Convert any \'s into /'s */ for (char *p=exc->fname; *p; p++) { if (*p == '\\') { - *p = '/'; + *p = '/'; } } #endif @@ -329,7 +331,7 @@ file_in_excluded_list(struct s_excluded_file *exc, const char *file) } for ( ; exc; exc=exc->next ) { if (fnmatch(exc->fname, file, fnmode|FNM_PATHNAME) == 0) { - Dmsg2(900, "Match exc pat=%s: file=%s:\n", exc->fname, file); + Dmsg2(900, "Match exc pat=%s: file=%s:\n", exc->fname, file); return 1; } Dmsg2(900, "No match exc pat=%s: file=%s:\n", exc->fname, file); diff --git a/bacula/src/version.h b/bacula/src/version.h index 374cee10a5..9184181ccc 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #undef VERSION #define VERSION "1.37.1" -#define BDATE "22 December 2004" -#define LSMDATE "22Dec04" +#define BDATE "24 December 2004" +#define LSMDATE "24Dec04" /* Debug flags */ #undef DEBUG