From: Eric Bollengier Date: Tue, 7 Jul 2015 08:44:50 +0000 (+0200) Subject: Fix #1131 about Job::Next Pool resource precedence over the Pool::Next pool directive X-Git-Tag: Release-7.4.0~113 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0783b04b2eceb5452a3655011e31dc82881f13a5;p=bacula%2Fbacula Fix #1131 about Job::Next Pool resource precedence over the Pool::Next pool directive --- diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 8d0bee11a2..03c3f2fd36 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -311,8 +311,13 @@ static bool get_next_pool(UAContext *ua, run_ctx &rc) rc.next_pool = select_pool_resource(ua); } } + /* NextPool can come from Job resource NextPool or Pool resource NextPool */ if (!rc.next_pool) { - rc.next_pool = rc.pool->NextPool; /* use default */ + if (rc.job->next_pool) { + rc.next_pool = rc.job->next_pool; + } else { + rc.next_pool = rc.pool->NextPool; /* use default */ + } } if (rc.next_pool && !acl_access_ok(ua, Pool_ACL, rc.next_pool->name())) { ua->error_msg(_("No authorization. NextPool \"%s\".\n"), rc.next_pool->name()); @@ -896,6 +901,8 @@ static bool set_run_context_in_jcr(UAContext *ua, JCR *jcr, run_ctx &rc) } if (rc.next_pool_name) { pm_strcpy(jcr->next_pool_source, _("Command input")); + } else if (jcr->next_pool == jcr->job->next_pool) { + pm_strcpy(jcr->next_pool_source, _("Job resource")); } else if (jcr->next_pool != jcr->pool->NextPool) { pm_strcpy(jcr->next_pool_source, _("User input")); }