pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/bacula Update bacula to 9.6.7nb2.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c8048d65a7f2
branches:  trunk
changeset: 452796:c8048d65a7f2
user:      jnemeth <jnemeth%pkgsrc.org@localhost>
date:      Sun May 16 06:56:31 2021 +0000

description:
Update bacula to 9.6.7nb2.

This is to fix upstream bug #2551.  This was originally thought to
only be a display problem, but can actually cause undesired database
access concurrency and possibly races.

diffstat:

 sysutils/bacula/Makefile                      |   5 +-
 sysutils/bacula/distinfo                      |   3 +-
 sysutils/bacula/patches/patch-src_dird_dird.c |  75 +++++++++++++++++++++++++++
 3 files changed, 79 insertions(+), 4 deletions(-)

diffs (112 lines):

diff -r bb24afbc9c35 -r c8048d65a7f2 sysutils/bacula/Makefile
--- a/sysutils/bacula/Makefile  Sun May 16 05:53:28 2021 +0000
+++ b/sysutils/bacula/Makefile  Sun May 16 06:56:31 2021 +0000
@@ -1,10 +1,9 @@
-# $NetBSD: Makefile,v 1.89 2021/04/21 11:42:38 adam Exp $
+# $NetBSD: Makefile,v 1.90 2021/05/16 06:56:31 jnemeth Exp $
 
 CONFLICTS+=            bacula-client-[0-9]* bacula-clientonly-[0-9]* bareos-[0-9]* bareos-clientonly-[0-9]*
 
-#PKGREVISION= 3
+PKGREVISION=   2
 
-PKGREVISION= 1
 .include "options.mk"
 
 PLIST_SRC=             PLIST.common
diff -r bb24afbc9c35 -r c8048d65a7f2 sysutils/bacula/distinfo
--- a/sysutils/bacula/distinfo  Sun May 16 05:53:28 2021 +0000
+++ b/sysutils/bacula/distinfo  Sun May 16 06:56:31 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.57 2020/12/12 23:51:19 jnemeth Exp $
+$NetBSD: distinfo,v 1.58 2021/05/16 06:56:31 jnemeth Exp $
 
 SHA1 (bacula-9.6.7.tar.gz) = cf548f4ab0b22761dfe2ddd5e9f0f29e0ccf77c8
 RMD160 (bacula-9.6.7.tar.gz) = 9361625af2bafca9595b0f259e832fba3de75653
@@ -12,6 +12,7 @@
 SHA1 (patch-src_console_Makefile.in) = f997b8f8bc8c7cca5b06a8f046558951caa14094
 SHA1 (patch-src_console_conio.c) = 92445b01e2ad17de5215315df916f1f1bd45108b
 SHA1 (patch-src_dird_Makefile.in) = 0f088f3af4bcacb260fb50124723babd69f5caee
+SHA1 (patch-src_dird_dird.c) = e1c8580399ddfb933ea6727cc541a7bf435eb501
 SHA1 (patch-src_filed_Makefile.in) = 12d7498d65c9f4f0a844a1c4648c782ce1b5ab48
 SHA1 (patch-src_filed_bacl.c) = 6eb8d9e5198d91ea52b8ab4a31bf0cc565f3ee07
 SHA1 (patch-src_filed_bacl__freebsd.c) = 0a90b6621e3b18b43f7f9e0d7af50ba7f17ca708
diff -r bb24afbc9c35 -r c8048d65a7f2 sysutils/bacula/patches/patch-src_dird_dird.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/bacula/patches/patch-src_dird_dird.c     Sun May 16 06:56:31 2021 +0000
@@ -0,0 +1,75 @@
+$NetBSD: patch-src_dird_dird.c,v 1.1 2021/05/16 06:56:31 jnemeth Exp $
+
+Upstream bug #2551:
+
+I noticed that the command "show catalog" is truncating the name of db_driver
+
+======================================
+*show catalog
+Catalog: name=MyCatalog address=localhost DBport=5432 db_name=bacula
+      db_driver=PostgreSQ db_user=bacula MutliDBConn=0
+*
+======================================
+
+Turns out that the bug is more than just a display problem
+(from the bacula-devel mailing list):
+
+To: bacula-devel%lists.sourceforge.net@localhost
+Message-ID: <c2515e90-0bf3-bc5e-1908-e7b23867b17a%baculasystems.com@localhost>
+Date: Wed, 20 Jan 2021 13:22:19 +0100
+Subject: Re: [Bacula-devel] Something amiss in bacula-9.6.7: Possible race
+ condition
+List-Id: Developer's email list <bacula-devel.lists.sourceforge.net>
+List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bacula-de
+vel>
+From: Eric Bollengier via Bacula-devel <bacula-devel%lists.sourceforge.net@localhost>
+
+Hello Martin,
+
+Very good detective work, this subtle issue was causing concurrent
+database access even if the batch mode was disabled. I have pushed the
+patch into the Branch-9.6 git repository.
+
+Best Regards,
+Eric
+
+> What is the output of "show catalog" in bconsole?  My guess is that you will
+> see db_driver=MySQ i.e. missing the final "L" of MySQL.  This will prevent it
+> from reusing the BDB object, leading to unexpected concurrency.
+>
+> The bug is caused by this change:
+>
+> diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c
+> index fdb1d97bf9..11c4406ea7 100644
+> --- a/bacula/src/dird/dird.c
+> +++ b/bacula/src/dird/dird.c
+> @@ -1265,7 +1265,7 @@ static bool check_catalog(cat_op mode)
+>             /* To copy dbdriver field into "CAT" catalog resource class (local
+)
+>              * from dbdriver in "BDB" catalog DB Interface class (global)
+>              */
+> -            strncpy(catalog->db_driver, BDB_db_driver, db_driver_len);
+> +            bstrncpy(catalog->db_driver, BDB_db_driver, db_driver_len);
+>           }
+>        }
+>
+> which was part of 9.6.4.
+>
+> To fix it, replace db_driver_len with db_driver_len+1 in this call to
+> bstrncpy.  This has been fixed in Bacula 11 because the seemingly minor
+> problem with "status catalog" was reported in
+> https://bugs.bacula.org/view.php?id=2551 but it looks like the significance of
+> it wasn't realized.
+
+
+--- src/dird/dird.c.orig       2020-12-10 13:26:39.000000000 +0000
++++ src/dird/dird.c
+@@ -1265,7 +1265,7 @@ static bool check_catalog(cat_op mode)
+            /* To copy dbdriver field into "CAT" catalog resource class (local)
+             * from dbdriver in "BDB" catalog DB Interface class (global)
+             */
+-            bstrncpy(catalog->db_driver, BDB_db_driver, db_driver_len);
++            bstrncpy(catalog->db_driver, BDB_db_driver, db_driver_len + 1);
+          }
+       }
+ 



Home | Main Index | Thread Index | Old Index