From 0783b04b2eceb5452a3655011e31dc82881f13a5 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 7 Jul 2015 10:44:50 +0200 Subject: [PATCH] Fix #1131 about Job::Next Pool resource precedence over the Pool::Next pool directive --- bacula/src/dird/ua_run.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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")); } -- 2.39.5