]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix default check_for_immutable() return value
authorMichal Rakowski <michal.rakowski@baculasystems.com>
Thu, 30 Dec 2021 15:22:32 +0000 (16:22 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:57 +0000 (13:56 +0200)
When we are not dealing with File device there is no need to
state that 'immutable' is set.

bacula/src/stored/dev.h
bacula/src/stored/vol_mgr.c

index c7dbbd2a292ea7c2f22cdc4bb7e87103a8ddc712..b0ae5599b1fb27e3b7f6a2a84ffb81ba6b59f97c 100644 (file)
@@ -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();};
index 766780b08ec604b3db2a8c24c7e168d7c1d0c194..0cd84a3f69c14c3b69a3a6bfa015b1e0b5282dcd 100644 (file)
@@ -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);