Package: release.debian.org Severity: normal Tags: stretch User: release.debian....@packages.debian.org Usertags: pu
Hi, I'd like to fix bug #889040 in stretch: * Fix backups failing with "No Volume name given". - Backport upstream commit: Don't return empty volname if volume is on unwanted vols list. The bug doesn't affect jessie and is already fixed in testing/unstable. A debdiff is attached. Felix
diff -Nru bareos-16.2.4/debian/changelog bareos-16.2.4/debian/changelog --- bareos-16.2.4/debian/changelog 2017-07-27 20:58:49.000000000 +0200 +++ bareos-16.2.4/debian/changelog 2018-02-02 10:58:25.000000000 +0100 @@ -1,3 +1,11 @@ +bareos (16.2.4-3+deb9u2) stretch; urgency=medium + + * Fix backups failing with "No Volume name given". (Closes: #889040) + - Backport upstream commit: Don't return empty volname if volume is on + unwanted vols list. + + -- Felix Geyer <felix.ge...@credativ.de> Fri, 02 Feb 2018 10:58:25 +0100 + bareos (16.2.4-3+deb9u1) stretch; urgency=medium * Fix permissions of bareos-dir logrotate config on upgrade. (Closes: #864926) diff -Nru bareos-16.2.4/debian/patches/fix-no-volume-name-given bareos-16.2.4/debian/patches/fix-no-volume-name-given --- bareos-16.2.4/debian/patches/fix-no-volume-name-given 1970-01-01 01:00:00.000000000 +0100 +++ bareos-16.2.4/debian/patches/fix-no-volume-name-given 2018-01-30 10:02:18.000000000 +0100 @@ -0,0 +1,38 @@ +From d1ff29b3988a7c0aed3c0394ccfb3904f0588ddf Mon Sep 17 00:00:00 2001 +From: Philipp Storz <philipp.st...@bareos.com> +Date: Tue, 25 Apr 2017 10:50:44 +0200 +Subject: [PATCH] Don't return empty volname if volume is on unwanted vols list + +When the volume was on the unwanted_list, the loop was +continued but the number of sql rows was not checked, so that +the code continued and returned an empty volumename. + +Fixes #691: Backup job fails with "No Volume name given." +--- + src/cats/sql_find.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/src/cats/sql_find.c b/src/cats/sql_find.c +index ef716b820..c354c8a98 100644 +--- a/src/cats/sql_find.c ++++ b/src/cats/sql_find.c +@@ -435,9 +435,18 @@ int db_find_next_volume(JCR *jcr, B_DB *mdb, int item, bool InChanger, MEDIA_DBR + } + + /* +- * See if this is not on the unwanted volumes list. ++ * Skip if volume is on unwanted volumes list. ++ * We need to reduce the number of rows by one ++ * and jump out if no more rows are available + */ + if (unwanted_volumes && is_on_unwanted_volumes_list(row[1], unwanted_volumes)) { ++ Dmsg1(50, "Volume %s is on unwanted_volume_list, skipping\n", row[1]); ++ num_rows-- ; ++ if ( num_rows <= 0) { ++ Dmsg1(50, "No more volumes in result, bailing out\n", row[1]); ++ sql_free_result(mdb); ++ goto bail_out; ++ } + continue; + } + diff -Nru bareos-16.2.4/debian/patches/series bareos-16.2.4/debian/patches/series --- bareos-16.2.4/debian/patches/series 2017-07-27 20:58:49.000000000 +0200 +++ bareos-16.2.4/debian/patches/series 2018-01-30 10:02:41.000000000 +0100 @@ -1,3 +1,4 @@ dont-generate-debian-files disable-fstype-test fix-sha1-file-corruption +fix-no-volume-name-given