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

Bug#870178: jessie-pu: package bareos/14.2.1+20141017gitc6c5b56-3+deb8u3



On Sun, 30 Jul 2017 21:37:20 +0200 Felix Geyer <fgeyer@debian.org> wrote:
> debdiff is attached.

Now for real.

Felix
diff --git a/debian/bareos-director.postinst b/debian/bareos-director.postinst
index 3fa2b4d7..4c92a068 100644
--- a/debian/bareos-director.postinst
+++ b/debian/bareos-director.postinst
@@ -48,6 +48,12 @@ case "$1" in
             cat ${DEFCONFIGDIR}/${CONFIG} > ${TARGET}.dist
         fi
         permissions
+
+        if dpkg --compare-versions "$2" lt-nl "14.2.1+20141017gitc6c5b56-3+deb8u3~"; then
+            if [ -e /etc/logrotate.d/bareos-dir ]; then
+                chmod -x /etc/logrotate.d/bareos-dir
+            fi
+        fi
         ;;
     abort-upgrade|abort-remove|abort-deconfigure)
         ;;
diff --git a/debian/changelog b/debian/changelog
index 5b847405..6d345f3b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+bareos (14.2.1+20141017gitc6c5b56-3+deb8u3) jessie; urgency=medium
+
+  * Fix permissions of bareos-dir logrotate config. (Closes: #864926)
+  * Fix file corruption when using SHA1 signature. (Closes: #869608)
+  * Add autopkgtest for SHA1 signature.
+
+ -- Felix Geyer <fgeyer@debian.org>  Thu, 27 Jul 2017 21:02:50 +0200
+
 bareos (14.2.1+20141017gitc6c5b56-3+deb8u2) jessie; urgency=medium
 
   * Fix GnuTLS backend initialization. (Closes: #819807)
diff --git a/debian/patches/fix-logrotate-permissions b/debian/patches/fix-logrotate-permissions
new file mode 100644
index 00000000..8a9ab2a8
--- /dev/null
+++ b/debian/patches/fix-logrotate-permissions
@@ -0,0 +1,11 @@
+--- a/platforms/debian/Makefile.in
++++ b/platforms/debian/Makefile.in
+@@ -17,7 +17,7 @@ install-autostart: install-autostart-fd install-autostart-sd install-autostart-d
+ 
+ install_logrotate:
+ 	@$(MKDIR) $(DESTDIR)/etc/logrotate.d
+-	@$(INSTALL_PROGRAM) ../../scripts/logrotate $(DESTDIR)/etc/logrotate.d/bareos-dir
++	@$(INSTALL_DATA) ../../scripts/logrotate $(DESTDIR)/etc/logrotate.d/bareos-dir
+ 
+ install-autostart-fd:
+ 	@echo "Installing bareos-fd boot script ..."
diff --git a/debian/patches/fix-sha1-file-corruption b/debian/patches/fix-sha1-file-corruption
new file mode 100644
index 00000000..6bf89319
--- /dev/null
+++ b/debian/patches/fix-sha1-file-corruption
@@ -0,0 +1,29 @@
+From 49be4618319e681a4ad79fde63e984df1748938c Mon Sep 17 00:00:00 2001
+From: Joerg Steffens <joerg.steffens@bareos.com>
+Date: Wed, 26 Jul 2017 21:57:38 +0200
+Subject: [PATCH] bugfix: prevents file corruptions by SHA1
+
+Fixes a bug when using SHA1 file signatures in Bareos version compiled
+without openssl.
+
+Fixes #838: File corruption with SHA1 signature
+---
+ src/lib/sha1.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/sha1.c b/src/lib/sha1.c
+index 9972cb2..f67c466 100644
+--- a/src/lib/sha1.c
++++ b/src/lib/sha1.c
+@@ -20,7 +20,8 @@ A million repetitions of "a"
+ #if __LITTLE_ENDIAN__
+ #define LITTLE_ENDIAN
+ #endif
+-/* #define SHA1HANDSOFF * Copies data before messing with it. */
++/* #define SHA1HANDSOFF * Copies data before messing with it. Do not modify original data! */
++#define SHA1HANDSOFF
+ 
+ #include "sha1.h"
+ 
+-- 
+2.7.4
diff --git a/debian/patches/series b/debian/patches/series
index 81c20717..aad49917 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,5 @@ fix_multi_volume_data_corruption.diff
 dont-create-db-in-tests.patch
 fix-tls-backend-initalization
 fix-tls-passive-fds
+fix-logrotate-permissions
+fix-sha1-file-corruption
diff --git a/debian/tests/control b/debian/tests/control
index 1b5fc4f2..7db4b2c8 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -10,6 +10,6 @@ Test-Command: test/all
 Restrictions: breaks-testbed needs-root allow-stderr
 Depends: bareos-database-sqlite3, bareos
 
-Tests: tls tls-passive
+Tests: tls tls-passive sha1
 Restrictions: breaks-testbed needs-root allow-stderr
 Depends: bareos-database-sqlite3, bareos
diff --git a/debian/tests/sha1 b/debian/tests/sha1
new file mode 100755
index 00000000..a0c84ebd
--- /dev/null
+++ b/debian/tests/sha1
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# stop on first error
+set -e
+
+sed -i "s#Signature = MD5.*#Signature = SHA1#" /etc/bareos/bareos-dir.conf
+
+echo "start testing ... "
+echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
+echo "USER: $USER"
+echo "DB: $DB"
+
+chown ${daemon_user}:${daemon_group} /etc/bareos/*.conf
+chmod ug=rw,o+r /etc/bareos/*.conf
+chmod a+rx /etc/bareos/
+
+ls -la /etc/bareos/
+
+case "$DB" in
+    postgres*)
+        su postgres -c /usr/lib/bareos/scripts/create_bareos_database
+        su postgres -c /usr/lib/bareos/scripts/make_bareos_tables
+        su postgres -c /usr/lib/bareos/scripts/grant_bareos_privileges
+        ;;
+    *)
+        /usr/lib/bareos/scripts/create_bareos_database
+        /usr/lib/bareos/scripts/make_bareos_tables
+        /usr/lib/bareos/scripts/grant_bareos_privileges
+        ;;
+esac
+
+echo "--------- restarting services ----------- "
+service bareos-dir restart
+service bareos-sd restart
+service bareos-fd restart
+sleep 10
+
+echo "--------- checking services ----------- "
+service bareos-dir status
+service bareos-sd status
+service bareos-fd status
+
+
+# enable bash debug
+set -v
+
+BACKUP_TEST_FILE=/usr/sbin/bareos.test
+
+echo -e "status dir" | bconsole
+echo
+echo "---- label a volume ----"
+echo -e "label volume=testvol pool=Full" | bconsole
+echo
+echo "----- create some file to test backup / restore ----"
+dd if=/dev/urandom of=${BACKUP_TEST_FILE} bs=1024 count=1100
+echo
+echo "------ trigger backup job -----"
+echo -e "run job=BackupClient1 yes\rwait" | bconsole | grep "Job queued. JobId="
+echo "status dir" | bconsole
+echo
+echo "------ trigger restore job -----"
+echo -e "restore select current\r2\rls\rmark usr\rdone\ryes\rwait" | bconsole
+echo "status dir" | bconsole
+if ! cmp ${BACKUP_TEST_FILE} /tmp/bareos-restores/${BACKUP_TEST_FILE}; then
+  echo "Restored file is corrupted"
+  exit 1
+fi

Reply to: