From: Eric Bollengier Date: Fri, 10 Mar 2023 08:16:53 +0000 (+0100) Subject: Fix bdb_find_next_volume() with VolEncrypted field X-Git-Tag: Beta-15.0.0~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9f951c6664e6e21d3f71eea3508c007c920769e;p=thirdparty%2Fbacula.git Fix bdb_find_next_volume() with VolEncrypted field The SQL query was not dealing with the mr->VolEncrypted=-1 value --- diff --git a/bacula/src/cats/sql_find.c b/bacula/src/cats/sql_find.c index 41b164c0d..30a6aa41c 100644 --- a/bacula/src/cats/sql_find.c +++ b/bacula/src/cats/sql_find.c @@ -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) {