diff options
author | Sven Hartge <sven@svenhartge.de> | 2021-01-25 09:56:10 +0100 |
---|---|---|
committer | Sven Hartge <sven@svenhartge.de> | 2021-01-25 09:56:10 +0100 |
commit | 938d46f6784e1d516204f6d6bec49fc7f643cfd5 (patch) | |
tree | 9f62b7e2b740c926098ec492f844bd0ac0f7d77b | |
parent | c80b346dd5a09e5c2eb00ef53d1f2359390f7b6a (diff) | |
parent | da06f8cd8f02f1b9b9ae8808e01e49e241ba8fd8 (diff) |
Merge commit 'da06f8cd8f02f1b9b9ae8808e01e49e241ba8fd8' into buster-backportsdebian/9.6.7-2_bpo10+1
-rw-r--r-- | debian/changelog | 18 | ||||
-rw-r--r-- | debian/patches/debian/fix-mysql-racecondition | 35 | ||||
-rw-r--r-- | debian/patches/series | 2 | ||||
-rw-r--r-- | debian/patches/upstream/btraceback-verbose | 76 |
4 files changed, 129 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index 8e5cc537..87a522c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,22 @@ -bacula (9.6.7-1~bpo10+1) buster-backports; urgency=medium +bacula (9.6.7-2~bpo10+1) buster-backports; urgency=medium * Rebuild for buster-backports. - -- Sven Hartge <sven@svenhartge.de> Sun, 13 Dec 2020 10:09:17 +0100 + -- Sven Hartge <sven@svenhartge.de> Mon, 25 Jan 2021 09:55:57 +0100 + +bacula (9.6.7-2) unstable; urgency=medium + + [ Carsten Leonhardt ] + * Backport btraceback from 11.0.1 to improve btraceback output + (Closes: #954971) + + [ Sven Hartge ] + * Fix bug in database locking code causing concurrency problems + and job failures by importing patch from https://bugs.gentoo.org/766195 + from Phil Stracchino <phils@caerllewys.net> and + Martin Simmons <martin@lispworks.com>. + + -- Carsten Leonhardt <leo@debian.org> Thu, 21 Jan 2021 23:30:02 +0100 bacula (9.6.7-1) unstable; urgency=high diff --git a/debian/patches/debian/fix-mysql-racecondition b/debian/patches/debian/fix-mysql-racecondition new file mode 100644 index 00000000..b8d73ba0 --- /dev/null +++ b/debian/patches/debian/fix-mysql-racecondition @@ -0,0 +1,35 @@ +Description: Bug in database locking code causes concurrency problems and job failures (patch attached) +Author: Phil Stracchino <phils@caerllewys.net> +Author: Martin Simmons <martin@lispworks.com> +Last-Update: 2021-01-19 +Forwarded: not-needed + +In Bacula 9.6.4, the following code change was made at src/dird/dird.c:1268 : + +- strncpy(catalog->db_driver, BDB_db_driver, db_driver_len); ++ bstrncpy(catalog->db_driver, BDB_db_driver, db_driver_len); + +It was not noticed at the time that this introduced an off-by-one error that +led to a bug in DB driver definition which prevents reuse of the BDB object, +leading to unexpected concurrency between jobs, leading in turn to job failures +due to race conditions writing to the database. + +The fix is to change that line to: + +bstrncpy(catalog->db_driver, BDB_db_driver, db_driver_len+1); + +--- a/src/dird/dird.c 2021-01-19 15:25:16.233573546 -0500 ++++ b/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"), diff --git a/debian/patches/series b/debian/patches/series index 68cde620..10f5ff78 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -20,3 +20,5 @@ debian/fix-desktop-in-files debian/non-silent-build #debian/fix-baculabackupreport-defaults debian/fix-usr_libexec_paths +upstream/btraceback-verbose +debian/fix-mysql-racecondition diff --git a/debian/patches/upstream/btraceback-verbose b/debian/patches/upstream/btraceback-verbose new file mode 100644 index 00000000..204f6086 --- /dev/null +++ b/debian/patches/upstream/btraceback-verbose @@ -0,0 +1,76 @@ +Description: Backport btraceback from 11.0.1 to improve btraceback output +Author: Eric Bollengier <eric@baculasystems.com> +Last-Update: 2021-01-06 +Bug-Debian: 954971 +Bug: https://bugs.bacula.org/view.php?id=2587 + + Fix org#2587 Improve btraceback output + + Reported by Carsten + + At Debian we had bug reports because of the emails that btraceback sends. + Apparently the users were confused because of a lack of explanation in the email. + +--- a/scripts/btraceback.in ++++ b/scripts/btraceback.in +@@ -2,7 +2,7 @@ + # + # Bacula(R) - The Network Backup Solution + # +-# Copyright (C) 2000-2016 Kern Sibbald ++# Copyright (C) 2000-2020 Kern Sibbald + # Copyright (C) 2000-2014 Free Software Foundation Europe e.V. + # + # The original author of Bacula is Kern Sibbald, with contributions +@@ -29,6 +29,17 @@ + # + PNAME=`basename $1` + WD="$3" ++# When parsing the configuration, the working directory is not ++# yet initialized ++if [ "$WD" = "" ]; then ++ WD=/tmp ++fi ++ ++# Start constructing message. Point to log files for better user ++# experience, append backtrace or message about missing debugger later ++echo "Check the log files for more information." > ${WD}/bacula.$2.traceback ++echo "" >> ${WD}/bacula.$2.traceback ++ + case `uname -s` in + SunOS) + # +@@ -46,20 +57,23 @@ + which mdb > /dev/null 2>&1 && MDB=`which mdb` || MDB='' + gcore -o ${WD}/${PNAME} $2 + if [ ! -z "${DBX}" ]; then +- ${DBX} $1 $2 < @scriptdir@/btraceback.dbx > ${WD}/bacula.$2.traceback 2>&1 ++ ${DBX} $1 $2 < @scriptdir@/btraceback.dbx >> ${WD}/bacula.$2.traceback 2>&1 + elif [ ! -z "${GDB}" ]; then +- ${GDB} -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 > ${WD}/bacula.$2.traceback 2>&1 ++ ${GDB} -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 >> ${WD}/bacula.$2.traceback 2>&1 + elif [ ! -z "${MDB}" ]; then +- ${MDB} -u -p $2 < @scriptdir@/btraceback.mdb > ${WD}/bacula.$2.traceback 2>&1 ++ ${MDB} -u -p $2 < @scriptdir@/btraceback.mdb >> ${WD}/bacula.$2.traceback 2>&1 + fi +- PNAME="${PNAME} on `hostname`" +- cat ${WD}/bacula.$2.traceback \ +- | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@ + ;; + *) +- gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 >${WD}/bacula.$2.traceback 2>&1 +- PNAME="${PNAME} on `hostname`" +- cat ${WD}/bacula.$2.traceback \ +- | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula GDB traceback of ${PNAME}" @dump_email@ ++ which gdb > /dev/null 2>&1 && GDB=`which gdb` || GDB='' ++ if [ ! -z "${GDB}" ]; then ++ gdb -quiet -batch -x @scriptdir@/btraceback.gdb $1 $2 >> ${WD}/bacula.$2.traceback 2>&1 ++ else ++ echo "Please install a debugger (gdb) to receive a traceback." >> ${WD}/bacula.$2.traceback 2>&1 ++ fi + ;; + esac ++ ++PNAME="${PNAME} on `hostname`" ++cat ${WD}/bacula.$2.traceback \ ++ | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula traceback. Process crashed ${PNAME}" @dump_email@ |