]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/2.2.x/2.2.3-migrate-vol.patch
Cleanup patches a bit
[bacula/bacula] / bacula / patches / 2.2.x / 2.2.3-migrate-vol.patch
1   This patch corrects a bug where the last volume of a migration 
2   job is incorrectly found producing an error.  This fixes bug #936.
3   Apply the patch to 2.2.3 (and possibly earlier 2.2.x versions) with:
4
5   cd <bacula-source>
6   patch -p0 <2.2.3-migrate-vol.patch
7   ./configure (your options)
8   make
9   ...
10   make install
11
12 Index: src/dird/migrate.c
13 ===================================================================
14 --- src/dird/migrate.c  (revision 5507)
15 +++ src/dird/migrate.c  (working copy)
16 @@ -1098,8 +1098,10 @@
17        if (mig_jcr->VolumeName[0]) {
18           /* Find last volume name. Multiple vols are separated by | */
19           char *p = strrchr(mig_jcr->VolumeName, '|');
20 -         if (!p) {
21 -            p = mig_jcr->VolumeName;
22 +         if (p) {
23 +            p++;                         /* skip | */
24 +         } else {
25 +            p = mig_jcr->VolumeName;     /* no |, take full name */
26           }
27           bstrncpy(mr.VolumeName, p, sizeof(mr.VolumeName));
28           if (!db_get_media_record(jcr, jcr->db, &mr)) {