commit: 465b334f163a88f6e045202c23c93cd36637e99a Author: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org> AuthorDate: Sat Jan 23 15:48:21 2021 +0000 Commit: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org> CommitDate: Sat Jan 23 15:48:21 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=465b334f
app-backup/bacula: Fix database locking bug (bug #766195) Reported-by: Phil Stracchino <phils <AT> caerllewys.net> Closes: https://bugs.gentoo.org/766195 Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org> app-backup/bacula/bacula-9.6.5.ebuild | 5 ++++- app-backup/bacula/bacula-9.6.6.ebuild | 5 ++++- app-backup/bacula/bacula-9.6.7.ebuild | 5 ++++- .../bacula/files/bacula-9.6.x-fix-race-condition.patch | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/app-backup/bacula/bacula-9.6.5.ebuild b/app-backup/bacula/bacula-9.6.5.ebuild index d2d04673ea7..13290a4abf9 100644 --- a/app-backup/bacula/bacula-9.6.5.ebuild +++ b/app-backup/bacula/bacula-9.6.5.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -171,6 +171,9 @@ src_prepare() { # correct installation for plugins to mode 0755 (bug #725946) sed -i -e "s/(INSTALL_PROGRAM) /(INSTALL_LIB) /" src/plugins/fd/Makefile.in ||die + # fix database locking code for bacula-9.6.4 ... -9.6.x (bug #766195) + eapply -p0 "${FILESDIR}"/${PN}-9.6.x-fix-race-condition.patch + # fix bundled libtool (bug 466696) # But first move directory with M4 macros out of the way. # It is only needed by autoconf and gives errors during elibtoolize. diff --git a/app-backup/bacula/bacula-9.6.6.ebuild b/app-backup/bacula/bacula-9.6.6.ebuild index 8b6104a81e9..aaffa58674b 100644 --- a/app-backup/bacula/bacula-9.6.6.ebuild +++ b/app-backup/bacula/bacula-9.6.6.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -171,6 +171,9 @@ src_prepare() { # correct installation for plugins to mode 0755 (bug #725946) sed -i -e "s/(INSTALL_PROGRAM) /(INSTALL_LIB) /" src/plugins/fd/Makefile.in ||die + # fix database locking code for bacula-9.6.4 ... -9.6.x (bug #766195) + eapply -p0 "${FILESDIR}"/${PN}-9.6.x-fix-race-condition.patch + # fix bundled libtool (bug 466696) # But first move directory with M4 macros out of the way. # It is only needed by autoconf and gives errors during elibtoolize. diff --git a/app-backup/bacula/bacula-9.6.7.ebuild b/app-backup/bacula/bacula-9.6.7.ebuild index 8b6104a81e9..aaffa58674b 100644 --- a/app-backup/bacula/bacula-9.6.7.ebuild +++ b/app-backup/bacula/bacula-9.6.7.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -171,6 +171,9 @@ src_prepare() { # correct installation for plugins to mode 0755 (bug #725946) sed -i -e "s/(INSTALL_PROGRAM) /(INSTALL_LIB) /" src/plugins/fd/Makefile.in ||die + # fix database locking code for bacula-9.6.4 ... -9.6.x (bug #766195) + eapply -p0 "${FILESDIR}"/${PN}-9.6.x-fix-race-condition.patch + # fix bundled libtool (bug 466696) # But first move directory with M4 macros out of the way. # It is only needed by autoconf and gives errors during elibtoolize. diff --git a/app-backup/bacula/files/bacula-9.6.x-fix-race-condition.patch b/app-backup/bacula/files/bacula-9.6.x-fix-race-condition.patch new file mode 100644 index 00000000000..4862bcece0e --- /dev/null +++ b/app-backup/bacula/files/bacula-9.6.x-fix-race-condition.patch @@ -0,0 +1,15 @@ +--- src/dird/dird.c.orig 2021-01-19 15:25:16.233573546 -0500 ++++ src/dird/dird.c 2021-01-19 15:26:23.884070798 -0500 +@@ -1263,11 +1263,11 @@ + } + if (catalog->db_driver) { + /* 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); + } + } + + if (!db || !db_open_database(NULL, db)) { + Pmsg2(000, _("Could not open Catalog \"%s\", database \"%s\".\n"),
