From: Eric Bollengier Date: Wed, 12 Dec 2018 10:25:23 +0000 (+0100) Subject: Fix #4449 about an incorrect pool selected with the restart command X-Git-Tag: Release-9.4.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2cc243d7e670936370b9e547f9bcc2449cb775e;p=thirdparty%2Fbacula.git Fix #4449 about an incorrect pool selected with the restart command --- diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 00f5b4bb6..5e7954b9d 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -42,6 +42,7 @@ public: JOB *verify_job; JOB *previous_job; JOB_DBR jr; + POOL_DBR pr; USTORE *store; CLIENT *client; FILESET *fileset; @@ -577,7 +578,6 @@ static bool get_jobid_list(UAContext *ua, sellist &sl, run_ctx &rc) static bool get_jobid_from_list(UAContext *ua, sellist &sl, run_ctx &rc) { int JobId; - if (rc.done) { return false; } @@ -596,9 +596,17 @@ static bool get_jobid_from_list(UAContext *ua, sellist &sl, run_ctx &rc) Dmsg3(100, "Job=%s JobId=%d JobStatus=%c\n", rc.jr.Name, rc.jr.JobId, rc.jr.JobStatus); rc.job_name = rc.jr.Name; + if (!get_job(ua, rc)) { return false; } + rc.pr.PoolId = rc.jr.PoolId; + if (!db_get_pool_record(ua->jcr, ua->db, &rc.pr)) { + ua->error_msg(_("Could not get pool record for selected JobId=%d. ERR=%s"), + rc.JobId, db_strerror(ua->db)); + return false; + } + rc.pool_name = rc.pr.Name; if (!get_pool(ua, rc)) { return false; }