]> git.sur5r.net Git - bacula/bacula/commitdiff
Save and restore volume name in stored/mount.c fixed bug #712
authorKern Sibbald <kern@sibbald.com>
Sun, 17 Dec 2006 09:00:50 +0000 (09:00 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 17 Dec 2006 09:00:50 +0000 (09:00 +0000)
     where wrong tape was requested in a mount.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3807 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/ua_purge.c
bacula/src/stored/mount.c
bacula/technotes-1.39

index 1b7e9661af21153d140b7af660f831c441f1e34a..261485d66545498650731497c814c476180f3776 100644 (file)
@@ -419,7 +419,7 @@ void purge_job_from_catalog(UAContext *ua, JobId_t JobId)
    POOL_MEM query(PM_MESSAGE);
    char ed1[50];
 
-   /* Remove job records */
+   /* Records associated with the job */
    purge_job_records_from_catalog(ua, JobId);
 
    /* Now remove the Job record itself */
index 2c24324ca1631ca41d3227663c3f17bd5fce160f..456bebb7499cd07b561c9d365fac8b79d11889cd 100644 (file)
@@ -247,6 +247,7 @@ read_volume:
       break;                    /* got a Volume */
    case VOL_NAME_ERROR:
       VOLUME_CAT_INFO dcrVolCatInfo, devVolCatInfo;
+      char VolumeName[MAX_NAME_LENGTH];
 
       /* If not removable, Volume is broken */
       if (!dev->is_removable()) {
@@ -272,6 +273,7 @@ read_volume:
       dcrVolCatInfo = dcr->VolCatInfo;      /* structure assignment */
       devVolCatInfo = dev->VolCatInfo;      /* structure assignment */
       /* Check if this is a valid Volume in the pool */
+      bstrncpy(VolumeName, dcr->VolumeName, sizeof(VolumeName));
       bstrncpy(dcr->VolumeName, dev->VolHdr.VolumeName, sizeof(dcr->VolumeName));
       if (!dir_get_volume_info(dcr, GET_VOL_INFO_FOR_WRITE)) {
          /* Restore desired volume name, note device info out of sync */
@@ -294,6 +296,7 @@ read_volume:
              jcr->dir_bsock->msg);
          ask = true;
          /* Restore saved DCR before continuing */
+         bstrncpy(dcr->VolumeName, VolumeName, sizeof(dcr->VolumeName));
          dcr->VolCatInfo = dcrVolCatInfo;  /* structure assignment */
          goto mount_next_vol;
       }
index e85ed2cfbe21d6a06168bb844a7460076afaf1ce..96416e72f04b22f6694dfde778af2dcdffab8c52 100644 (file)
@@ -2,6 +2,8 @@
 
 General:
 16Dec06
+kes  Save and restore volume name in stored/mount.c fixed bug #712
+     where wrong tape was requested in a mount.
 kes  Implement cleaner orphan buffer dumping with buf address.
 kes  Fix orphaned buffer when canceling job waiting on op intervention.
 kes  Update projects file for next vote.