]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #4449 about an incorrect pool selected with the restart command
authorEric Bollengier <eric@baculasystems.com>
Wed, 12 Dec 2018 10:25:23 +0000 (11:25 +0100)
committerKern Sibbald <kern@sibbald.com>
Wed, 12 Dec 2018 11:14:43 +0000 (12:14 +0100)
bacula/src/dird/ua_run.c

index 00f5b4bb68dc70da9da6d119299877dd0083d28a..5e7954b9d6d78d32231f079ddea80c5c3287e06b 100644 (file)
@@ -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;
    }