From 68e37bb49cdbe6cacd0044e307d34b55a56a9577 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 12 Sep 2007 07:17:50 +0000 Subject: [PATCH] kes Fix migration code to get correct Volume name with multiple volumes by skipping |. Fixes bug #936. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@5529 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.2.3-migrate-vol.patch | 28 ++++++++++++++++ bacula/src/dird/migrate.c | 6 ++-- bacula/src/version.h | 6 ++-- bacula/technotes-2.1 | 2 ++ bacula/technotes-2.3 | 46 ++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 bacula/patches/2.2.3-migrate-vol.patch diff --git a/bacula/patches/2.2.3-migrate-vol.patch b/bacula/patches/2.2.3-migrate-vol.patch new file mode 100644 index 0000000000..cdb0a366cb --- /dev/null +++ b/bacula/patches/2.2.3-migrate-vol.patch @@ -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 + 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)) { diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index 223328c1f5..c0f183d05a 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -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)) { diff --git a/bacula/src/version.h b/bacula/src/version.h index 6cf785efc3..684d24b4c3 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "2.2.3" -#define BDATE "09 September 2007" -#define LSMDATE "09Sep07" +#define VERSION "2.2.4" +#define BDATE "12 September 2007" +#define LSMDATE "12Sep07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 3e941770b2..5be0b7b220 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -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 Move patches into patches directory. diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 00d106eee6..81abacb685 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,52 @@ Technical notes on version 2.3 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 + program. +kes Move patches into patches directory. +11Sep07 +ebl Fix bug #946 about "bacula-dir -t" witch doesn't works + as expected. +09Sep07 +ebl Using "m" in bconsole will show messages like before, + and not memory usage. +kes Fix bug #935, and probably also bug #903 where files were not + restored. MediaId was not properly set in JobMedia record after + a Volume change. +08Sep07 +kes Suppress chown and chmod error messages if the FD is not running + as root. +07Sep07 +kes Apply Martin Simmons patch that should turn off the new API usage + when batch insert is turned off allowing building on older + PostgreSQLs. +kes Add ./configure search in qwt-qt4 for qwt package +05Sep07 +kes Bacula is now free of 3rd party GPL copyrighted code! +kes Remove idcache.c +kes Add guid_to_name.c/h which replace idcache. +kes Remove enh_fnmatch.c. Make code that references it use fnmatch.c +04Sep07 +ebl Detect if new PosgreSQL batch insert API is present. +kes Correct incorrect mempool call causing Director crash. +sb Update spec files for 2.2.1 release +03Sep07 +kes Fix memory pool call in ua_output.c. bug #934. +kes Replace fnmatch.c and fnmatch.h by modified BSD versions. + Add test program to fnmatch.c +02Sep07 +kes Integrate patch to README.vc8 from + Hederer Jean-Sébastien