]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix problem with manual labelling volumes with 'ProtectVolumes'
authorMichal Rakowski <michal.rakowski@baculasystems.com>
Thu, 16 Dec 2021 17:49:07 +0000 (18:49 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:57 +0000 (13:56 +0200)
bacula/src/stored/file_dev.c

index e6d5b6ec07cf254278f96b2f81fe00a72106c153..a7895911ebb65e9ffdf96ba39ecb8e3a39dbfaff 100644 (file)
@@ -570,6 +570,12 @@ bool file_dev::check_volume_protection_time(const char *vol_name)
    get_volume_fpath(vol_name, fname.handle());
 
    if (stat(fname.c_str(), &sp)) {
+      if (errno == ENOENT) {
+         /* Volume does not exist at all so we can just proceed */
+         return true;
+      }
+
+      /* We have an error otherwise */
       berrno be;
       Mmsg2(errmsg, "Failed to stat %s, ERR=%s", fname.c_str(), be.bstrerror());
       return false;