From: Eric Bollengier Date: Wed, 30 Aug 2023 09:40:45 +0000 (+0200) Subject: Fix #10365 Pass comment field to copy/migration jobs from the control job X-Git-Tag: Beta-15.0.1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fb13444aca9a42563642f926e255f623982a3ac;p=thirdparty%2Fbacula.git Fix #10365 Pass comment field to copy/migration jobs from the control job --- diff --git a/bacula/src/dird/mac.c b/bacula/src/dird/mac.c index a4a317b99..bc2eaaaf1 100644 --- a/bacula/src/dird/mac.c +++ b/bacula/src/dird/mac.c @@ -187,6 +187,11 @@ bool do_mac_init(JCR *jcr) wjcr = new_jcr(sizeof(JCR), dird_free_jcr); memcpy(&wjcr->previous_jr, &jcr->previous_jr, sizeof(wjcr->previous_jr)); + /* Adjust the Comment field from the control job */ + if (jcr->comment[0]) { + pm_strcpy(wjcr->comment, jcr->comment); + } + /* * Turn the wjcr into a "real" job that takes on the aspects of * the previous backup job "prev_job". @@ -764,6 +769,13 @@ void start_mac_job(JCR *jcr) Mmsg(ua->cmd, "run job=\"%s\" jobid=%s ignoreduplicatecheck=yes pool=\"%s\"", jcr->job->name(), edit_uint64(jcr->MigrateJobId, ed1), jcr->pool->name()); + + if (is_comment_legal(NULL, jcr->comment)) { + pm_strcat(ua->cmd, " comment=\""); + pm_strcat(ua->cmd, jcr->comment); + pm_strcat(ua->cmd, "\""); + } + if (jcr->next_pool) { bsnprintf(args, sizeof(args), " nextpool=\"%s\"", jcr->next_pool->name()); pm_strcat(ua->cmd, args);