From: Michal Rakowski Date: Thu, 16 Dec 2021 17:49:07 +0000 (+0100) Subject: Fix problem with manual labelling volumes with 'ProtectVolumes' X-Git-Tag: Beta-15.0.0~716 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4d46569f44dfb38e0e279b94a5bfd5510924eee;p=thirdparty%2Fbacula.git Fix problem with manual labelling volumes with 'ProtectVolumes' --- diff --git a/bacula/src/stored/file_dev.c b/bacula/src/stored/file_dev.c index e6d5b6ec0..a7895911e 100644 --- a/bacula/src/stored/file_dev.c +++ b/bacula/src/stored/file_dev.c @@ -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;