From: Kern Sibbald Date: Sun, 17 Dec 2006 09:00:50 +0000 (+0000) Subject: Save and restore volume name in stored/mount.c fixed bug #712 X-Git-Tag: Release-7.0.0~7226 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=169976ff5823a81b80648277a77a607e1ada5cce;p=bacula%2Fbacula Save and restore volume name in stored/mount.c fixed bug #712 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 --- diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index 1b7e9661af..261485d665 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -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 */ diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 2c24324ca1..456bebb749 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -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; } diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index e85ed2cfbe..96416e72f0 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -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.