]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
initialize encrypted volume when recycling with rewrite_volume_label()
authorAlain Spineux <alain@baculasystems.com>
Fri, 18 Nov 2022 15:30:42 +0000 (16:30 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
bacula/src/stored/label.c

index 77412aaf92cad16034e92dc0bcdcd3025e06b06e..8362a1581c267fdb6b82d03b02f6207e128d56cb 100644 (file)
@@ -598,6 +598,9 @@ bool DEVICE::rewrite_volume_label(DCR *dcr, bool recycle)
       }
    }
 
+   if (!load_encryption_key(dcr, "LABEL", dcr->VolumeName, &VolHdr.EncCypherKeySize, VolHdr.EncCypherKey, &VolHdr.MasterKeyIdSize, VolHdr.MasterKeyId)) {
+      return false;
+   }
    if (!write_volume_label_to_block(dcr)) {
       Dmsg0(150, "Error from write volume label.\n");
       Leave(100);