From: Michal Rakowski Date: Thu, 30 Dec 2021 15:22:32 +0000 (+0100) Subject: Fix default check_for_immutable() return value X-Git-Tag: Beta-15.0.0~692 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13388f0ec6e3ec5dbd8512b403da15740ae9f277;p=thirdparty%2Fbacula.git Fix default check_for_immutable() return value When we are not dealing with File device there is no need to state that 'immutable' is set. --- diff --git a/bacula/src/stored/dev.h b/bacula/src/stored/dev.h index c7dbbd2a2..b0ae5599b 100644 --- a/bacula/src/stored/dev.h +++ b/bacula/src/stored/dev.h @@ -604,7 +604,7 @@ public: virtual bool set_immutable(const char *vol_name) { return true; }; virtual bool clear_immutable(const char *vol_name) { return true; }; virtual bool check_volume_protection_time(const char *vol_name) { return true; }; - virtual bool check_for_immutable(const char *vol_name) { return true; }; + virtual bool check_for_immutable(const char *vol_name) { return false; }; virtual const char *print_type() = 0; /* in dev.c */ virtual const char *print_driver_type() { return "";}; virtual const char *print_full_type() { return print_type();}; diff --git a/bacula/src/stored/vol_mgr.c b/bacula/src/stored/vol_mgr.c index 766780b08..0cd84a3f6 100644 --- a/bacula/src/stored/vol_mgr.c +++ b/bacula/src/stored/vol_mgr.c @@ -835,7 +835,7 @@ bool DCR::can_i_write_volume() return false; } - if (dev->check_for_immutable(VolumeName)) { + if (dev->device->set_vol_immutable && dev->check_for_immutable(VolumeName)) { MmsgD1(dbglvl, jcr->errmsg, _("Skipping writing onto Volume %s, " "because Volume's Protection Period has not expired yet\n"), VolumeName);