summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorjnemeth <jnemeth@pkgsrc.org>2021-05-16 06:56:31 +0000
committerjnemeth <jnemeth@pkgsrc.org>2021-05-16 06:56:31 +0000
commitd79b4833b2b5ba996dbcc2f34c69ce87e8c194e9 (patch)
treeeed3d7a2248f4dfc1eff9a0125525e646239b69f /sysutils
parent6983d193dae684876ba412d6e1a29f7cb24751fc (diff)
downloadpkgsrc-d79b4833b2b5ba996dbcc2f34c69ce87e8c194e9.tar.gz
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 (limited to 'sysutils')
-rw-r--r--sysutils/bacula/Makefile5
-rw-r--r--sysutils/bacula/distinfo3
-rw-r--r--sysutils/bacula/patches/patch-src_dird_dird.c75
3 files changed, 79 insertions, 4 deletions
diff --git a/sysutils/bacula/Makefile b/sysutils/bacula/Makefile
index 87b2a21a6a5..f88d386dfbe 100644
--- a/sysutils/bacula/Makefile
+++ b/sysutils/bacula/Makefile
@@ -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 --git a/sysutils/bacula/distinfo b/sysutils/bacula/distinfo
index d450a3a5533..a4dce0bf3ed 100644
--- a/sysutils/bacula/distinfo
+++ b/sysutils/bacula/distinfo
@@ -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_bacula.h) = 74fed45f9d441a132f113fdfd783b8f5bb077885
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 --git a/sysutils/bacula/patches/patch-src_dird_dird.c b/sysutils/bacula/patches/patch-src_dird_dird.c
new file mode 100644
index 00000000000..8582c4ebc4b
--- /dev/null
+++ b/sysutils/bacula/patches/patch-src_dird_dird.c
@@ -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
+Message-ID: <c2515e90-0bf3-bc5e-1908-e7b23867b17a@baculasystems.com>
+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>
+
+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);
+ }
+ }
+