From: Alain Spineux Date: Wed, 3 Mar 2021 10:54:16 +0000 (+0100) Subject: Fix #7286 DIR segfault when doing a "dir" command in a restore X-Git-Tag: Release-11.0.2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc7612f5fe63a50fba78799d7e0dce69c237db8f;p=thirdparty%2Fbacula.git Fix #7286 DIR segfault when doing a "dir" command in a restore - this initialize "ua->jcr->db" as it is done few lines below at the first initialization - the ticket shows that ua->db was used successfully by other functions few line before the crash while ua->jcr->db == NULL. - it could be a fix (I cannot shows that) - it could be a new bug (I don't see how) - it is probably an improvement as the first and the next calls will return a consistent "ua" --- diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 2d2d69d65..805cdc74d 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -2722,10 +2722,10 @@ bool open_db(UAContext *ua) * private or the shared link */ if (ua->force_mult_db_connections) { - ua->db = ua->private_db; + ua->jcr->db = ua->db = ua->private_db; } else { - ua->db = ua->shared_db; + ua->jcr->db = ua->db = ua->shared_db; } if (ua->db) {