]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Try to fix bug on RunScript {} resource parsing
authorEric Bollengier <eric@eb.homelinux.org>
Sun, 6 Aug 2006 20:03:30 +0000 (20:03 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Sun, 6 Aug 2006 20:03:30 +0000 (20:03 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3261 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/dird_conf.c

index c26b1a7fcf707a09a14c5221c3d626e8907ed9c1..ae7e927459fe49945d8d06731473975e744fd525 100644 (file)
@@ -1673,8 +1673,6 @@ static void store_short_runscript(LEX *lc, RES_ITEM *item, int index, int pass)
    scan_to_eol(lc);
 }
 
-static RUNSCRIPT  res_runscript;
-
 /*
  * new RunScript items
  *   name             handler         value                                code flags default_value
@@ -1701,10 +1699,11 @@ static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass)
 {
    int token, i;
    alist **runscripts = (alist **)(item->value) ;
+   RUNSCRIPT  *res_runscript = &res_all.res_runscript;
 
    Dmsg1(200, "store_runscript: begin store_runscript pass=%i\n", pass);
 
-   res_runscript.reset_default();      /* setting on_success, on_failure, abort_on_error */
+   res_runscript->reset_default();      /* setting on_success, on_failure, abort_on_error */
    
    token = lex_get_token(lc, T_SKIP_EOL);
    
@@ -1739,18 +1738,18 @@ static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass)
    }
 
    if (pass == 2) {
-      if (res_runscript.command == NULL) {
+      if (res_runscript->command == NULL) {
          scan_err2(lc, _("%s item is required in %s resource, but not found.\n"),
                    "command", "runscript");
       }
 
       /* run on client by default */
-      if (res_runscript.target == NULL) {
-         res_runscript.set_target("%c");
+      if (res_runscript->target == NULL) {
+         res_runscript->set_target("%c");
       }
 
       RUNSCRIPT *script = new_runscript();
-      memcpy(script, &res_runscript, sizeof(RUNSCRIPT));
+      memcpy(script, res_runscript, sizeof(RUNSCRIPT));
       
       if (*runscripts == NULL) {
         *runscripts = New(alist(10, not_owned_by_alist));