]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #8356 About very small max volume size
authorMichal Rakowski <michal.rakowski@baculasystems.com>
Tue, 23 Nov 2021 15:34:36 +0000 (16:34 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:56 +0000 (13:56 +0200)
bacula/src/dird/dird.c
bacula/src/stored/stored.c

index e2ab105efb8d7921cd93afc49984fd5633b9edb8..8e9c0b91d02437133c1e41220066c96d0eaf9f68 100644 (file)
@@ -1322,6 +1322,14 @@ static bool check_resources()
               pool->name());
          OK = false;
       }
+
+      if (pool->MaxVolBytes && (pool->MaxVolBytes < 1024*1024)) {
+         Jmsg(NULL, M_FATAL, 0,
+               _("Invalid (too small) MaximumVolumeBytes: %llu for pool: %s. "
+                 "MaxVolBytes should be bigger or equal to 1048576 bytes\n"),
+               pool->MaxVolBytes, pool->hdr.name);
+         OK = false;
+      }
    }
 
    /* verify a Collector resource */
index 58308bedd8ce2fbba20268137606bc00d546d773..7f32d1a86b5bac73b4a535aef59cc6b237a4ee70 100644 (file)
@@ -434,6 +434,16 @@ static int check_resources()
       OK = false;
    }
 
+   foreach_res(device, R_DEVICE) {
+      if (device->max_volume_size && (device->max_volume_size < 1024*1024)) {
+         Jmsg(NULL, M_FATAL, 0,
+               _("Invalid (too small) MaximumVolumeSize: %llu for device: %s. "
+                 "MaxVolSize should be bigger or equal to 1048576 bytes\n"),
+               device->max_volume_size, device->hdr.name);
+         OK = false;
+      }
+   }
+
    if (me && !me->messages) {
       me->messages = (MSGS *)GetNextRes(R_MSGS, NULL);
       if (!me->messages) {