]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply patch from bug 1876 to permit dot commands in a runscript
authorKern Sibbald <kern@sibbald.com>
Sat, 9 Jun 2012 10:35:02 +0000 (12:35 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:47 +0000 (14:50 +0200)
bacula/src/dird/job.c

index 768b6cf1cfe34924ffca573c9ec4b50c18fd29ce..f769d20881e5c77cc39a5b3b3e661a9780582ccc 100644 (file)
@@ -1458,12 +1458,16 @@ bool run_console_command(JCR *jcr, const char *cmd)
    bool ok;
    JCR *ljcr = new_control_jcr("-RunScript-", JT_CONSOLE);
    ua = new_ua_context(ljcr);
-   /* run from runscript and check if commands are autorized */
+   /* run from runscript and check if commands are authorized */
    ua->runscript = true;
    Mmsg(ua->cmd, "%s", cmd);
    Dmsg1(100, "Console command: %s\n", ua->cmd);
    parse_ua_args(ua);
-   ok= do_a_command(ua);
+   if (ua->argc > 0 && ua->argk[0][0] == '.') {
+      ok = do_a_dot_command(ua);
+   } else {
+     ok = do_a_command(ua);
+   }
    free_ua_context(ua);
    free_jcr(ljcr);
    return ok;