]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/2.2.4-restore.patch
Zeroth integration of plugins
[bacula/bacula] / bacula / patches / 2.2.4-restore.patch
1
2  This patch resolves bug #955 where the director segfault when
3  where= option isn't specified anywhere.
4
5  Apply to version 2.2.4 (and perhaps older 2.2.x versions) with
6
7  cd <bacula-source>
8  patch -p0 <2.2.4-restore.patch
9  ./configure (your options)
10  make
11  ...
12  make install
13
14
15 Index: src/dird/restore.c
16 ===================================================================
17 --- src/dird/restore.c  (revision 5601)
18 +++ src/dird/restore.c  (working copy)
19 @@ -173,7 +173,7 @@
20     }
21  
22     /* Send restore command */
23 -   char replace, *where, *cmd=NULL;
24 +   char replace, *where, *cmd;
25     char empty = '\0';
26  
27     if (jcr->replace != 0) {
28 @@ -183,8 +183,6 @@
29     } else {
30        replace = REPLACE_ALWAYS;       /* always replace */
31     }
32 -   
33 -   where = &empty;                    /* default */
34  
35     if (jcr->RegexWhere) {
36        where = jcr->RegexWhere;             /* override */
37 @@ -199,7 +197,11 @@
38     } else if (jcr->job->RestoreWhere) {
39        where = jcr->job->RestoreWhere; /* no override take from job */
40        cmd = restorecmd;
41 -   } 
42 +
43 +   } else {                          /* nothing was specified */
44 +      where = &empty;                /* use default */
45 +      cmd   = restorecmd;                   
46 +   }
47     
48     jcr->prefix_links = jcr->job->PrefixLinks;
49