]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix the seg fault at the end of a job in the FD when using
authorKern Sibbald <kern@sibbald.com>
Fri, 24 Dec 2004 10:23:54 +0000 (10:23 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 24 Dec 2004 10:23:54 +0000 (10:23 +0000)
  old style include/excludes.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1779 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/patches/1.36.1-fileset.patch [new file with mode: 0644]
bacula/patches/patches-1.36.1
bacula/src/findlib/match.c
bacula/src/version.h

diff --git a/bacula/patches/1.36.1-fileset.patch b/bacula/patches/1.36.1-fileset.patch
new file mode 100644 (file)
index 0000000..99104c1
--- /dev/null
@@ -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 <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);
index 23bfed574f4fe24f81e0d253aa5cb623d0b501e5..20177531124202648ff44ab4673466bf49883e54 100644 (file)
@@ -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.
index fe84276b3cb74da018fe2d828a0dc9b0bb2b8aba..b83653f8f98db1a4131ca85661b0ab3d9c8aa48c 100644 (file)
@@ -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);
index 374cee10a54f8a91c6c108fb320940b56949453a..9184181cccbe3bae893eec0cb04be466cbd3b68f 100644 (file)
@@ -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