]> git.sur5r.net Git - bacula/bacula/commitdiff
- Fix Storage overrides in Run directive
authorKern Sibbald <kern@sibbald.com>
Wed, 29 Sep 2004 19:58:17 +0000 (19:58 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 29 Sep 2004 19:58:17 +0000 (19:58 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1623 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/dird/job.c
bacula/src/dird/msgchan.c

index 6fbd0bc14384d4bc9e559bcd3c88a222f92960a4..2b1a10ec9d0a6d2e84c70a477dbaec7072763a8d 100644 (file)
@@ -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
index 05bd0dcd5dd8b8be03c1148504d01a7aa76c4667..f909cf23fbb66486689393f196e2beb014ce06e6 100644 (file)
@@ -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; i<MAX_STORE; i++) {
-           ua->jcr->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; i<MAX_STORE; i++) {
       jcr->storage[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;
index 36bd6a21d167f8bae93304f9e1b94ff631157b76..9733f0f6ebc411b20c4c5f4c6c5726cde8f7872a 100644 (file)
@@ -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;