]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/1.36.1/1.36.1-fileset.patch
Cleanup patches a bit
[bacula/bacula] / bacula / patches / 1.36.1 / 1.36.1-fileset.patch
1
2  This patch should correct a seg fault in the FD that occurs
3  at the end of a job when the job uses old style include/excludes.
4  Apply the patch to version 1.36.1 with:
5
6  cd <bacula-source>
7  patch -p0 <1.36.1-fileset.patch
8  make
9  make install
10  ...
11
12 Index: src/findlib/match.c
13 ===================================================================
14 RCS file: /cvsroot/bacula/bacula/src/findlib/match.c,v
15 retrieving revision 1.21
16 diff -u -r1.21 match.c
17 --- src/findlib/match.c 21 Dec 2004 16:18:37 -0000      1.21
18 +++ src/findlib/match.c 24 Dec 2004 10:17:29 -0000
19 @@ -10,7 +10,7 @@
20   *
21   */
22  /*
23 -   Copyright (C) 2001-2004 Kern Sibbald and John Walker
24 +   Copyright (C) 2001-2004 Kern Sibbald
25  
26     This program is free software; you can redistribute it and/or
27     modify it under the terms of the GNU General Public License as
28 @@ -74,19 +74,21 @@
29        free(inc);
30        inc = next_inc;
31     }
32 +   ff->included_files_list = NULL;
33  
34     for (exc=ff->excluded_files_list; exc; ) {
35        next_exc = exc->next;
36        free(exc);
37        exc = next_exc;
38     }
39 +   ff->excluded_files_list = NULL;
40  
41     for (exc=ff->excluded_paths_list; exc; ) {
42        next_exc = exc->next;
43        free(exc);
44        exc = next_exc;
45     }
46 -
47 +   ff->excluded_paths_list = NULL;
48  }
49  
50  /*
51 @@ -111,42 +113,42 @@
52     if (prefixed) {
53        for (rp=fname; *rp && *rp != ' '; rp++) {
54          switch (*rp) {
55 -        case 'a':                 /* alway replace */
56 -        case '0':                 /* no option */
57 +         case 'a':                 /* alway replace */
58 +         case '0':                 /* no option */
59             break;
60 -        case 'f':
61 +         case 'f':
62             inc->options |= FO_MULTIFS;
63             break;
64 -        case 'h':                 /* no recursion */
65 +         case 'h':                 /* no recursion */
66             inc->options |= FO_NO_RECURSION;
67             break;
68 -        case 'M':                 /* MD5 */
69 +         case 'M':                 /* MD5 */
70             inc->options |= FO_MD5;
71             break;
72 -        case 'n':
73 +         case 'n':
74             inc->options |= FO_NOREPLACE;
75             break;
76 -        case 'p':                 /* use portable data format */
77 +         case 'p':                 /* use portable data format */
78             inc->options |= FO_PORTABLE;
79             break;
80 -        case 'r':                 /* read fifo */
81 +         case 'r':                 /* read fifo */
82             inc->options |= FO_READFIFO;
83             break;
84 -        case 'S':
85 +         case 'S':
86             inc->options |= FO_SHA1;
87             break;
88 -        case 's':
89 +         case 's':
90             inc->options |= FO_SPARSE;
91             break;
92 -        case 'm':
93 +         case 'm':
94             inc->options |= FO_MTIMEONLY;
95             break;
96 -        case 'k':
97 +         case 'k':
98             inc->options |= FO_KEEPATIME;
99             break;
100 -        case 'V':                  /* verify options */
101 +         case 'V':                  /* verify options */
102             /* Copy Verify Options */
103 -           for (j=0; *rp && *rp != ':'; rp++) {
104 +            for (j=0; *rp && *rp != ':'; rp++) {
105                inc->VerifyOpts[j] = *rp;
106                if (j < (int)sizeof(inc->VerifyOpts) - 1) {
107                   j++;
108 @@ -154,19 +156,19 @@
109             }
110             inc->VerifyOpts[j] = 0;
111             break;
112 -        case 'w':
113 +         case 'w':
114             inc->options |= FO_IF_NEWER;
115             break;
116 -        case 'A':
117 +         case 'A':
118             inc->options |= FO_ACL;
119             break;
120 -        case 'Z':                 /* gzip compression */
121 +         case 'Z':                 /* gzip compression */
122             inc->options |= FO_GZIP;
123 -           inc->level = *++rp - '0';
124 -           Dmsg1(200, "Compression level=%d\n", inc->level);
125 +            inc->level = *++rp - '0';
126 +            Dmsg1(200, "Compression level=%d\n", inc->level);
127             break;
128          default:
129 -           Emsg1(M_ERROR, 0, "Unknown include/exclude option: %c\n", *rp);
130 +            Emsg1(M_ERROR, 0, "Unknown include/exclude option: %c\n", *rp);
131             break;
132          }
133        }
134 @@ -199,7 +201,7 @@
135     /* Convert any \'s into /'s */
136     for (p=inc->fname; *p; p++) {
137        if (*p == '\\') {
138 -        *p = '/';
139 +         *p = '/';
140        }
141     }
142  #endif
143 @@ -249,7 +251,7 @@
144     /* Convert any \'s into /'s */
145     for (char *p=exc->fname; *p; p++) {
146        if (*p == '\\') {
147 -        *p = '/';
148 +         *p = '/';
149        }
150     }
151  #endif
152 @@ -329,7 +331,7 @@
153     }
154     for ( ; exc; exc=exc->next ) {
155        if (fnmatch(exc->fname, file, fnmode|FNM_PATHNAME) == 0) {
156 -        Dmsg2(900, "Match exc pat=%s: file=%s:\n", exc->fname, file);
157 +         Dmsg2(900, "Match exc pat=%s: file=%s:\n", exc->fname, file);
158          return 1;
159        }
160        Dmsg2(900, "No match exc pat=%s: file=%s:\n", exc->fname, file);