From: Michal Rakowski Date: Fri, 23 Apr 2021 12:47:22 +0000 (+0200) Subject: Fix #7552 About running wrong jopy job X-Git-Tag: Release-11.3.2~560 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d763856a4243a277fce35f3cfa02b91526e84fda;p=thirdparty%2Fbacula.git Fix #7552 About running wrong jopy job This issue might happen when the user had a backup job named "Backup1" and later changed the type of the job from Type = Backup to Type = Copy. --- diff --git a/bacula/src/dird/mac.c b/bacula/src/dird/mac.c index 1d4657a2b..2570e9d1c 100644 --- a/bacula/src/dird/mac.c +++ b/bacula/src/dird/mac.c @@ -170,6 +170,14 @@ bool do_mac_init(JCR *jcr) return false; } + /* Check for bug #7552 - to be sure that user is doing the right thing */ + if (prev_job->JobType != JT_BACKUP || + prev_job->JobType != JT_JOB_COPY || + prev_job->JobType != JT_MIGRATED_JOB) { + Jmsg(jcr, M_FATAL, 0, _("Unexpected type ('%c') of job to copy:\"%s\".\n"), + prev_job->JobType, jcr->previous_jr.Name); + return false; + } /* Create a write jcr */ wjcr = jcr->wjcr = new_jcr(sizeof(JCR), dird_free_jcr);