]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix bdb_find_next_volume() with VolEncrypted field
authorEric Bollengier <eric@baculasystems.com>
Fri, 10 Mar 2023 08:16:53 +0000 (09:16 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:01 +0000 (13:57 +0200)
The SQL query was not dealing with the mr->VolEncrypted=-1 value

bacula/src/cats/sql_find.c

index 41b164c0db20ab4467b8f3d61d70b0824381e982..30a6aa41c010c0116f5d2fb944789f5a085dd856 100644 (file)
@@ -473,7 +473,7 @@ int BDB::bdb_find_next_volume(JCR *jcr, int item, bool InChanger, MEDIA_DBR *mr)
       } else {
          order = sql_media_order_most_recently_written[bdb_get_type_index()];    /* take most recently written */
       }
-      if (strcmp(mr->VolStatus, "Append") == 0) {
+      if (strcmp(mr->VolStatus, "Append") == 0 && mr->VolEncrypted != fnv_encrypted_any) {
          Mmsg(volencrypted, "AND VolEncrypted=%d", mr->VolEncrypted);
       }
       if (mr->VolType == 0) {