From: Eric Bollengier Date: Mon, 23 May 2022 10:04:26 +0000 (+0200) Subject: Do not add an empty Storage line when generating the BSR X-Git-Tag: Release-13.0.0~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc4442c433e983874e42db4ca1e0e26aac3da80b;p=thirdparty%2Fbacula.git Do not add an empty Storage line when generating the BSR After a bscan, the catalog may not have the information about the storage resource to use for a volume. In that case, we skip the Storage= line. --- diff --git a/bacula/src/dird/bsr.c b/bacula/src/dird/bsr.c index 25f90c260..f97e61b17 100644 --- a/bacula/src/dird/bsr.c +++ b/bacula/src/dird/bsr.c @@ -367,7 +367,9 @@ static uint32_t write_bsr_item(RBSR *bsr, UAContext *ua, find_storage_resource(ua, rx, bsr->VolParams[i].Storage, bsr->VolParams[i].MediaType); } - fprintf(fd, "Storage=\"%s\"\n", bsr->VolParams[i].Storage); + if (strcmp(bsr->VolParams[i].Storage, "") != 0) { + fprintf(fd, "Storage=\"%s\"\n", bsr->VolParams[i].Storage); + } fprintf(fd, "Volume=\"%s\"\n", bsr->VolParams[i].VolumeName); fprintf(fd, "MediaType=\"%s\"\n", bsr->VolParams[i].MediaType); if (bsr->fileregex) {