--- /dev/null
+
+ 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 <bacula-source>
+ 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);
*
*/
/*
- 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
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;
}
/*
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++;
}
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;
}
}
/* Convert any \'s into /'s */
for (p=inc->fname; *p; p++) {
if (*p == '\\') {
- *p = '/';
+ *p = '/';
}
}
#endif
/* Convert any \'s into /'s */
for (char *p=exc->fname; *p; p++) {
if (*p == '\\') {
- *p = '/';
+ *p = '/';
}
}
#endif
}
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);