From: Eric Bollengier Date: Thu, 11 Aug 2016 16:12:58 +0000 (+0200) Subject: Fix #335 Avoid backups going to the scratch pool X-Git-Tag: Release-7.4.4~15 X-Git-Url: https://git.sur5r.net/?p=bacula%2Fbacula;a=commitdiff_plain;h=63cac8c503ae2ca1e89ed41900262f1e7779b069 Fix #335 Avoid backups going to the scratch pool --- diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 0aeb67696b..fc27f61d93 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -149,7 +149,6 @@ int run_cmd(UAContext *ua, const char *cmd) break; /* error get out of while loop */ } - /* Run without prompting? */ if (ua->batch || find_arg(ua, NT_("yes")) > 0) { return start_job(ua, jcr, rc); @@ -1072,6 +1071,11 @@ static bool set_run_context_in_jcr(UAContext *ua, JCR *jcr, run_ctx &rc) jcr->IgnoreDuplicateJobChecking = rc.ignoreduplicatecheck; } + /* Not a good idea to start a job with the Scratch pool */ + if (rc.pool && strcmp(rc.pool->name, NT_("Scratch")) == 0) { + ua->send_msg(_("Pool \"Scratch\" not valid.\n")); + return false; + } return true; }