From: Kern Sibbald Date: Wed, 29 Sep 2004 19:58:17 +0000 (+0000) Subject: - Fix Storage overrides in Run directive X-Git-Tag: Release-1.35.6~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c3ce442c79a852741fee0e5f31d36fad48874dd9;p=bacula%2Fbacula - Fix Storage overrides in Run directive git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1623 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 6fbd0bc143..2b1a10ec9d 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -17,6 +17,7 @@ Version 1.35 Kern (see below) block numbers in btape "test". Possibly adjust in Bacula. - Fix possible bug in update volumefrompool (email 9/28 from jesk@killall.org +- Fix storage overrides in Run directives. - Document a get out of jail procedure if everything breaks if you lost/broke the Catalog -- do the same for "I know my diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 05bd0dcd5d..f909cf23fb 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -337,9 +337,10 @@ int cancel_job(UAContext *ua, JCR *jcr) /* Cancel Storage daemon */ if (jcr->store_bsock) { - ua->jcr->store = jcr->store; - for (int i=0; ijcr->storage[i] = jcr->storage[i]; + if (!ua->jcr->storage[0]) { + copy_storage(ua->jcr, jcr); + } else { + ua->jcr->store = jcr->store; } if (!connect_to_storage_daemon(ua->jcr, 10, SDConnectTimeout, 1)) { bsendmsg(ua, _("Failed to connect to Storage daemon.\n")); @@ -747,7 +748,7 @@ void set_jcr_defaults(JCR *jcr, JOB *job) for (int i=0; istorage[i] = job->storage[i]; } - if (jcr->storage[0]) { + if (!jcr->store && jcr->storage[0]) { jcr->store = (STORE *)jcr->storage[0]->first(); } jcr->client = job->client; diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c index 36bd6a21d1..9733f0f6eb 100644 --- a/bacula/src/dird/msgchan.c +++ b/bacula/src/dird/msgchan.c @@ -66,7 +66,7 @@ bool connect_to_storage_daemon(JCR *jcr, int retry_interval, BSOCK *sd; STORE *store = jcr->store; if (!store) { - store = (STORE *)jcr->storage[0]->first(); + jcr->store = store = (STORE *)jcr->storage[0]->first(); } /* @@ -82,7 +82,6 @@ bool connect_to_storage_daemon(JCR *jcr, int retry_interval, } sd->res = (RES *)store; /* save pointer to other end */ jcr->store_bsock = sd; - jcr->store = store; if (!authenticate_storage_daemon(jcr, store)) { return false;