From: Eric Bollengier Date: Thu, 13 Mar 2008 14:50:46 +0000 (+0000) Subject: ebl Fix new runscript multiple command X-Git-Tag: Release-7.0.0~4839 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5e70231c4ca1e035795a7e005faac68b7bb67391;p=bacula%2Fbacula ebl Fix new runscript multiple command git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6603 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index a50001a0c6..86a2e5f4d2 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -1887,14 +1887,14 @@ static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass) Dmsg1(200, "store_runscript: begin store_runscript pass=%i\n", pass); - res_runscript.reset_default(); /* setting on_success, on_failure, fail_on_error */ - token = lex_get_token(lc, T_SKIP_EOL); if (token != T_BOB) { scan_err1(lc, _("Expecting open brace. Got %s"), lc->str); } - + /* setting on_success, on_failure, fail_on_error */ + res_runscript.reset_default(); + if (pass == 2) { res_runscript.commands = New(alist(10, not_owned_by_alist)); } @@ -1941,10 +1941,10 @@ static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass) res_runscript.set_job_code_callback(job_code_callback_filesetname); while ((c=(char*)res_runscript.commands->pop()) != NULL) { t = (int) res_runscript.commands->pop(); - res_runscript.command = c; - res_runscript.cmd_type = t; RUNSCRIPT *script = new_runscript(); memcpy(script, &res_runscript, sizeof(RUNSCRIPT)); + script->command = c; + script->cmd_type = t; /* target is taken from res_runscript, each runscript object have * a copy */ @@ -1955,6 +1955,8 @@ static void store_runscript(LEX *lc, RES_ITEM *item, int index, int pass) script->debug(); } delete res_runscript.commands; + /* setting on_success, on_failure... cleanup target field */ + res_runscript.reset_default(true); } scan_to_eol(lc);