]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Fix migration code to get correct Volume name with multiple volumes
authorKern Sibbald <kern@sibbald.com>
Wed, 12 Sep 2007 07:18:32 +0000 (07:18 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 12 Sep 2007 07:18:32 +0000 (07:18 +0000)
     by skipping |.  Fixes bug #936.

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

bacula/patches/2.2.3-migrate-vol.patch [new file with mode: 0644]
bacula/src/dird/migrate.c
bacula/technotes-2.3

diff --git a/bacula/patches/2.2.3-migrate-vol.patch b/bacula/patches/2.2.3-migrate-vol.patch
new file mode 100644 (file)
index 0000000..cdb0a36
--- /dev/null
@@ -0,0 +1,28 @@
+  This patch corrects a bug where the last volume of a migration 
+  job is incorrectly found producing an error.  This fixes bug #936.
+  Apply the patch to 2.2.3 (and possibly earlier 2.2.x versions) with:
+
+  cd <bacula-source>
+  patch -p0 <2.2.3-migrate-vol.patch
+  ./configure (your options)
+  make
+  ...
+  make install
+
+Index: src/dird/migrate.c
+===================================================================
+--- src/dird/migrate.c (revision 5507)
++++ src/dird/migrate.c (working copy)
+@@ -1098,8 +1098,10 @@
+       if (mig_jcr->VolumeName[0]) {
+          /* Find last volume name. Multiple vols are separated by | */
+          char *p = strrchr(mig_jcr->VolumeName, '|');
+-         if (!p) {
+-            p = mig_jcr->VolumeName;
++         if (p) {
++            p++;                         /* skip | */
++         } else {
++            p = mig_jcr->VolumeName;     /* no |, take full name */
+          }
+          bstrncpy(mr.VolumeName, p, sizeof(mr.VolumeName));
+          if (!db_get_media_record(jcr, jcr->db, &mr)) {
index 223328c1f561b55f12f69988ffb65f4b5f7e9f91..c0f183d05a4a856ccacf9b6ea8a6540953d60ea4 100644 (file)
@@ -1098,8 +1098,10 @@ void migration_cleanup(JCR *jcr, int TermCode)
       if (mig_jcr->VolumeName[0]) {
          /* Find last volume name. Multiple vols are separated by | */
          char *p = strrchr(mig_jcr->VolumeName, '|');
-         if (!p) {
-            p = mig_jcr->VolumeName;
+         if (p) {
+            p++;                         /* skip | */
+         } else {
+            p = mig_jcr->VolumeName;     /* no |, take full name */
          }
          bstrncpy(mr.VolumeName, p, sizeof(mr.VolumeName));
          if (!db_get_media_record(jcr, jcr->db, &mr)) {
index 1390c5c1eba80b8b08f561dea76159efe14ba51f..81abacb68589fd80da8b804a3a81908173592633 100644 (file)
@@ -2,6 +2,8 @@
 
 General:
 12Sep07
+kes  Fix migration code to get correct Volume name with multiple volumes 
+     by skipping |.  Fixes bug #936.
 kes  Implement patch supplied by Landon to fix bug #944 where using
      TLS with bconsole uses 99+% of the CPU.
 kes  Note, you need GTK >= 2.10 to be able to link the Tray Monitor