]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix VolEncrypted in get_scratch_volume()
authorAlain Spineux <alain@baculasystems.com>
Tue, 15 Nov 2022 15:11:41 +0000 (16:11 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
- get_scratch_volume() was not using the right VolEncrypted value for
  the SQL query
- this fix tests :
failed   651s  tests/copy-uncopied-test
failed   651s  tests/copy-volume-test
failed   651s  tests/next-vol-test
failed    69s  tests/verify-data-test
failed   651s  tests/scratchpool-pool-test

bacula/src/dird/next_vol.c

index 3d8e06bc5c3ee2a0e1c96b02d23cbeef6558d079..91e0cd32edb622625e0be1268199e1860f5814a6 100644 (file)
@@ -474,6 +474,7 @@ bool get_scratch_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr,
    bmemset(&spr, 0, sizeof(spr));
    bstrncpy(spr.Name, "Scratch", sizeof(spr.Name));
    spr.PoolId = mr->ScratchPoolId;
+   smr.VolEncrypted = mr->VolEncrypted;
    if (db_get_pool_record(jcr, jcr->db, &spr)) {
       smr.PoolId = spr.PoolId;
       bstrncpy(smr.VolStatus, "Append", sizeof(smr.VolStatus));  /* want only appendable volumes */