aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Frankenberger <simon@fraho.eu>2020-08-03 19:10:40 +0200
committerFrancesco Colista <fcolista@alpinelinux.org>2020-08-05 07:07:47 +0000
commite58991972afb5a1d00694776f46e65df69dd1203 (patch)
treea39dc0d0d9349a853707ca3a3b3d744d48841631
parentca29e2886dcec3af2a8d9c0117450d14e580566e (diff)
downloadaports-e58991972afb5a1d00694776f46e65df69dd1203.tar.gz
aports-e58991972afb5a1d00694776f46e65df69dd1203.tar.bz2
aports-e58991972afb5a1d00694776f46e65df69dd1203.tar.xz
community/bareos: upgrade to 19.2.8
-rw-r--r--community/bareos/649ae58a65f6cdbcf7ee770a0d5b5cf51b5e412b.patch248
-rw-r--r--community/bareos/APKBUILD23
-rw-r--r--community/bareos/add-libintl.patch14
-rw-r--r--community/bareos/nginx-conf.patch2
-rw-r--r--community/bareos/path-mounted.patch4
5 files changed, 23 insertions, 268 deletions
diff --git a/community/bareos/649ae58a65f6cdbcf7ee770a0d5b5cf51b5e412b.patch b/community/bareos/649ae58a65f6cdbcf7ee770a0d5b5cf51b5e412b.patch
deleted file mode 100644
index b3da31b05e..0000000000
--- a/community/bareos/649ae58a65f6cdbcf7ee770a0d5b5cf51b5e412b.patch
+++ /dev/null
@@ -1,248 +0,0 @@
-This is the official patch for the SEGV issue with incorrect pthread usage.
-
-https://gitlab.alpinelinux.org/alpine/aports/issues/10156
-https://github.com/alpinelinux/aports/pull/6951
-
-Patch downloaded from:
-https://github.com/bareos/bareos/commit/649ae58a65f6cdbcf7ee770a0d5b5cf51b5e412b
-(patch had to be modified slightly to apply)
-
-As soon as this patch is included in in upstream release, this patch may be removed.
-As far as I can see, this should be the case with bareos 18.2.7 or later.
-
---- old/core/cmake/BareosFindAllLibraries.cmake
-+++ new/core/cmake/BareosFindAllLibraries.cmake
-@@ -84,3 +84,4 @@
- endif()
-
- find_package(Readline)
-+INCLUDE(thread)
---- /dev/null
-+++ new/core/cmake/thread.cmake
-@@ -0,0 +1,21 @@
-+INCLUDE(CheckIncludeFiles)
-+INCLUDE(CheckCSourceCompiles)
-+
-+# check for extra non-portable header-file
-+CHECK_INCLUDE_FILES("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H)
-+
-+# pthread_attr_get_np - e.g. on FreeBSD
-+SET(CMAKE_REQUIRED_LIBRARIES ${PTHREAD_LIBRARIES})
-+IF(HAVE_PTHREAD_NP_H)
-+ CHECK_C_SOURCE_COMPILES("
-+ #include <pthread.h>
-+ #include <pthread_np.h>
-+ int main() { pthread_attr_t a; pthread_attr_get_np(pthread_self(), &a); }
-+ " HAVE_PTHREAD_ATTR_GET_NP)
-+ELSE()
-+ CHECK_C_SOURCE_COMPILES("
-+ #include <pthread.h>
-+ int main() { pthread_attr_t a; pthread_attr_get_np(pthread_self(), &a); }
-+ " HAVE_PTHREAD_ATTR_GET_NP)
-+ENDIF()
-+SET(CMAKE_REQUIRED_LIBRARIES)
---- old/core/src/dird/CMakeLists.txt
-+++ new/core/src/dird/CMakeLists.txt
-@@ -37,7 +37,7 @@
- ua_cmds.cc ua_configure.cc ua_db.cc ua_dotcmds.cc ua_input.cc ua_impexp.cc
- ua_label.cc ua_output.cc ua_prune.cc ua_purge.cc ua_query.cc ua_restore.cc
- ua_run.cc ua_select.cc ua_server.cc ua_status.cc ua_tree.cc ua_update.cc
-- vbackup.cc verify.cc)
-+ vbackup.cc verify.cc pthread_detach_if_not_detached.cc)
- IF(HAVE_WIN32)
- LIST(APPEND DIRD_OBJECTS_SRCS ../win32/dird/dirdres.rc)
- ENDIF()
---- old/core/src/dird/dird.cc
-+++ new/core/src/dird/dird.cc
-@@ -661,6 +661,7 @@
- is_reloading = false;
- return reloaded;
- }
-+
- } /* namespace directordaemon */
-
- /*
---- /dev/null
-+++ b/core/src/dird/pthread_detach_if_not_detached.cc
-@@ -0,0 +1,48 @@
-+/*
-+ BAREOSĀ® - Backup Archiving REcovery Open Sourced
-+
-+ Copyright (C) 2019-2019 Bareos GmbH & Co. KG
-+
-+ This program is Free Software; you can redistribute it and/or
-+ modify it under the terms of version three of the GNU Affero General Public
-+ License as published by the Free Software Foundation and included
-+ in the file LICENSE.
-+
-+ This program is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Affero General Public License for more details.
-+
-+ You should have received a copy of the GNU Affero General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+ 02110-1301, USA.
-+*/
-+#include "include/hostconfig.h"
-+#include <pthread.h>
-+#if defined(HAVE_PTHREAD_NP_H)
-+#include <pthread_np.h>
-+#endif
-+#include "pthread_detach_if_not_detached.h"
-+
-+namespace directordaemon {
-+void DetachIfNotDetached(pthread_t thr)
-+{
-+#if defined(HAVE_WIN32)
-+ pthread_detach(thr);
-+#else
-+ /* only detach if not yet detached */
-+ int _detachstate;
-+ pthread_attr_t _gattr;
-+#if defined(HAVE_PTHREAD_ATTR_GET_NP)
-+ pthread_attr_init(&_gattr);
-+ pthread_attr_get_np(thr, &_gattr);
-+#else
-+ pthread_getattr_np(thr, &_gattr);
-+#endif
-+ pthread_attr_getdetachstate(&_gattr, &_detachstate);
-+ pthread_attr_destroy(&_gattr);
-+ if (_detachstate != PTHREAD_CREATE_DETACHED) { pthread_detach(thr); }
-+#endif
-+}
-+} // namespace directordaemon
---- /dev/null
-+++ b/core/src/dird/pthread_detach_if_not_detached.h
-@@ -0,0 +1,29 @@
-+/*
-+ BAREOSĀ® - Backup Archiving REcovery Open Sourced
-+
-+ Copyright (C) 2019-2019 Bareos GmbH & Co. KG
-+
-+ This program is Free Software; you can redistribute it and/or
-+ modify it under the terms of version three of the GNU Affero General Public
-+ License as published by the Free Software Foundation and included
-+ in the file LICENSE.
-+
-+ This program is distributed in the hope that it will be useful, but
-+ WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Affero General Public License for more details.
-+
-+ You should have received a copy of the GNU Affero General Public License
-+ along with this program; if not, write to the Free Software
-+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-+ 02110-1301, USA.
-+*/
-+
-+#ifndef BAREOS_DIRD_THREAD_H_
-+#define BAREOS_DIRD_THREAD_H_
-+#include <pthread.h>
-+
-+namespace directordaemon {
-+void DetachIfNotDetached(pthread_t thr);
-+} // namespace directordaemon
-+#endif // BAREOS_DIRD_THREAD_H_
---- old/core/src/dird/job.cc
-+++ new/core/src/dird/job.cc
-@@ -39,6 +39,7 @@
- #include "dird/fd_cmds.h"
- #include "dird/job.h"
- #include "dird/migration.h"
-+#include "dird/pthread_detach_if_not_detached.h"
- #include "dird/restore.h"
- #include "dird/sd_cmds.h"
- #include "dird/stats.h"
-@@ -455,7 +456,7 @@
- {
- JobControlRecord *jcr = (JobControlRecord *)arg;
-
-- pthread_detach(pthread_self());
-+ DetachIfNotDetached(pthread_self());
- Dsm_check(100);
-
- Dmsg0(200, "=====Start Job=========\n");
---- old/core/src/dird/ua_server.cc
-+++ new/core/src/dird/ua_server.cc
-@@ -34,6 +34,7 @@
- #include "dird/authenticate.h"
- #include "dird/authenticate_console.h"
- #include "dird/job.h"
-+#include "dird/pthread_detach_if_not_detached.h"
- #include "dird/ua_cmds.h"
- #include "dird/ua_db.h"
- #include "dird/ua_input.h"
-@@ -41,6 +42,7 @@
- #include "dird/ua_server.h"
- #include "lib/bnet.h"
-
-+
- namespace directordaemon {
-
- /**
-@@ -77,7 +79,7 @@
- */
- void *HandleUserAgentClientRequest(BareosSocket *user_agent_socket)
- {
-- pthread_detach(pthread_self());
-+ DetachIfNotDetached(pthread_self());
-
- JobControlRecord *jcr = new_control_jcr("-Console-", JT_CONSOLE);
-
---- old/core/src/include/config.h.in
-+++ new/core/src/include/config.h.in
-@@ -34,6 +34,12 @@
- /* Define to 1 if you have 4.4BSD and OSF1 statfs to get filesystem type */
- #cmakedefine FSTYPE_STATFS @FSTYPE_STATFS@
-
-+// Define to 1 for pthread_attr_get_np() instead of pthread_getattr_np()
-+#cmakedefine HAVE_PTHREAD_ATTR_GET_NP @HAVE_PTHREAD_ATTR_GET_NP@
-+
-+// Define to 1 if pthread_*_np() are in a seperate header
-+#cmakedefine HAVE_PTHREAD_NP_H @HAVE_PTHREAD_NP_H@
-+
- /* Define to 1 if you have SVR4 statvfs to get filesystem type */
- #cmakedefine FSTYPE_STATVFS @FSTYPE_STATVFS@
-
---- old/core/src/lib/jcr.cc
-+++ new/core/src/lib/jcr.cc
-@@ -79,6 +79,7 @@
- static pthread_mutex_t job_start_mutex = PTHREAD_MUTEX_INITIALIZER;
- static pthread_mutex_t last_jobs_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-+static bool jcr_initialized = false;
- #ifdef HAVE_WIN32
- static bool tsd_initialized = false;
- static pthread_key_t jcr_key; /* Pointer to jcr for each thread */
-@@ -324,6 +325,8 @@
- if (status != 0) {
- BErrNo be;
- Jmsg1(nullptr, M_ABORT, 0, _("pthread key create failed: ERR=%s\n"), be.bstrerror(status));
-+ } else {
-+ jcr_initialized = true;
- }
- }
-
-@@ -681,7 +684,10 @@
- */
- JobControlRecord *get_jcr_from_tsd()
- {
-- JobControlRecord *jcr = (JobControlRecord *)pthread_getspecific(jcr_key);
-+ JobControlRecord* jcr = (JobControlRecord*)INVALID_JCR;
-+ if (jcr_initialized){
-+ jcr = (JobControlRecord*)pthread_getspecific(jcr_key);
-+ }
-
- /*
- * Set any INVALID_JCR to nullptr which the rest of BAREOS understands
-@@ -696,7 +702,7 @@
- */
- uint32_t GetJobidFromTsd()
- {
-- JobControlRecord *jcr = (JobControlRecord *)pthread_getspecific(jcr_key);
-+ JobControlRecord* jcr = get_jcr_from_tsd();
- uint32_t JobId = 0;
-
- if (jcr && jcr != INVALID_JCR) { JobId = (uint32_t)jcr->JobId; }
diff --git a/community/bareos/APKBUILD b/community/bareos/APKBUILD
index ed3eb35f68..2bcadbb7e1 100644
--- a/community/bareos/APKBUILD
+++ b/community/bareos/APKBUILD
@@ -2,7 +2,7 @@
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=bareos
-pkgver=18.2.8
+pkgver=19.2.8
pkgrel=0
pkgdesc="Bareos - Backup Archiving REcovery Open Sourced"
url="http://www.bareos.org"
@@ -10,7 +10,6 @@ url="http://www.bareos.org"
arch="all !mips !mips64"
options="!check"
license="AGPL-3.0"
-depends=""
makedepends="cmake gawk
lzo-dev acl-dev gettext-dev
readline-dev ncurses-dev jansson-dev
@@ -22,7 +21,7 @@ $pkgname-mysql:_mysql $pkgname-sqlite:_sqlite $pkgname-postgresql:_postgresql
$pkgname-webui:_webui:noarch $pkgname-webui-apache2:_webui_apache2:noarch $pkgname-webui-nginx:_webui_nginx:noarch"
pkgusers=$pkgname
pkggroups=$pkgname
-source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/Release/$pkgver.tar.gz
+source="$pkgname-$pkgver.tar.gz::https://github.com/bareos/bareos/archive/Release/$pkgver.tar.gz
$pkgname-dir.initd
$pkgname-sd.initd
$pkgname-fd.initd
@@ -30,13 +29,16 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/Re
add-libintl.patch
nginx-conf.patch
path-mounted.patch
- 649ae58a65f6cdbcf7ee770a0d5b5cf51b5e412b.patch
"
-builddir="$srcdir"/${pkgname}-Release-${pkgver}
+builddir="$srcdir"/$pkgname-Release-$pkgver
+
+# secfixes:
+# 19.2.8-r0:
+# - CVE-2020-4042
+# - CVE-2020-11061
prepare() {
default_prepare
- cd "$builddir"
mkdir -pv core/platforms/alpine
touch core/platforms/alpine/CMakeLists.txt
@@ -185,12 +187,11 @@ _webui_nginx() {
}
-sha512sums="61c9155a02ec0f3a21e06db4f5701dabb25411219d98940b50912c16ac38ec007584a7ef9728f2f12acf2823339a25eba3c9b34a6fa9e625a1d2d0778653b860 bareos-18.2.8.tar.gz
+sha512sums="60bbbbd949a63f978cf1ed7d0cfc22c22f117d8c2700eb47531e15b2d91fc700c522519f0b816cd1040283f09b4c81f36910c66c8b6f4bf1ff22180e979bdeb5 bareos-19.2.8.tar.gz
eb1e7072b579bf9ae21f2e351d6900abb277db64e373f4760bac8188b82929376e4a196d2c935cefe1ae4cc2c396f2fcba1a25642b26e2f92a0d008fbdc4b5f2 bareos-dir.initd
c770b1d041fafef93d4eb0269ba8d9733e85ef465657fe8dd5d5c68a27ec773cec9c5c582d4a16596d95bbf6dbd3f7194dc9c0d8ed73138e9fb438fba9aa9445 bareos-sd.initd
c6347079dbcef5f4a69ec0c4ecc31803520d715d599d89c6bbfbb3741a86c50d7295c30432889b13ee9c16f2feaa84b1c6ae992cfee6505d569c6493d7e85a5b bareos-fd.initd
1251d81d142b58bb2f5ab2ea762068fe2273aa5face9dfd314011706e9c2189ecab36b80f76317a595679f164b124cff85623c1ec98cc6997e350b6223f2a524 detect-alpine.patch
-1439b8f72e39ca27689dbcc1a58c63f22b7dc4d4bee480408a4c388e30c0c3434915e5162fa7e55d16b3a80c9e4727b96263ab5edc9dda52acb38737e136f147 add-libintl.patch
-0f73f38237a2320785b565d92c175de2c0c333081723c98b026f188b67ad738b5157222bc233811c6dafda3ddcdabf6849d5eeccc6723e0506e35923309cbcee nginx-conf.patch
-2fb3d059185efb9c492d865ed79810971992ea2d8609639b4260b3338cbd0e89dc8ad0b3031be868d13b21ed9a93ff444703332f0864bbec7ce3e691210d05f7 path-mounted.patch
-5bbad4f2b831ac51b41319965675ff7d828ab518eb87b682e91e49fdd10d2ee6580968a5cf79df5bda5f3bad957ce251d40b561a48dab5b32bc217a972d1276b 649ae58a65f6cdbcf7ee770a0d5b5cf51b5e412b.patch"
+9d12f26d77d384ab122fdb133667b17a1e83c748d9fca9ca810c368b8f4f3cb2fc258f7c54628e96a0347e7f996c00f46d89655aad2fee373a61e7433fd783b9 add-libintl.patch
+c2fd44d5880b74b24d8001b0798a1a42936347284633b9dd93d604a642c7b15220e5af66cbceb8919263e85b3cfee866cf3f956046ab7cc0d93edce96ad1ecda nginx-conf.patch
+2053eb72bbdb8c02d9ee7dcf387a973e0203485eb85304f1e1513ad501f6738d9fc0bb97596d6d9a1a8c96f6675fd2d2edafc85e961a5bd370b5f22f320c7cbf path-mounted.patch"
diff --git a/community/bareos/add-libintl.patch b/community/bareos/add-libintl.patch
index 4a3af85d11..9bfc3f56f6 100644
--- a/community/bareos/add-libintl.patch
+++ b/community/bareos/add-libintl.patch
@@ -4,12 +4,12 @@ diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index ae33cd0..2fe8906 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
-@@ -103,6 +103,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- set(HAVE_LINUX_OS 1)
- set(PSCMD "ps -e")
- include_directories(/usr/include/tirpc)
-+ link_directories(/usr/lib)
-+ link_libraries(intl)
+@@ -236,6 +236,8 @@
+ set(HAVE_LINUX_OS 1)
+ set(PSCMD "ps -e")
+ include_directories(/usr/include/tirpc)
++ link_directories(/usr/lib)
++ link_libraries(intl)
endif()
- if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+ if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
diff --git a/community/bareos/nginx-conf.patch b/community/bareos/nginx-conf.patch
index 8c756f25a8..e3d4dbd39a 100644
--- a/community/bareos/nginx-conf.patch
+++ b/community/bareos/nginx-conf.patch
@@ -1,3 +1,5 @@
+Fix default configuration for bareos-webui to work on alpine
+
--- old/webui/install/nginx/bareos-webui.conf
+++ new/webui/install/nginx/bareos-webui.conf
@@ -2,7 +2,7 @@
diff --git a/community/bareos/path-mounted.patch b/community/bareos/path-mounted.patch
index bd950f23b5..5691c086a8 100644
--- a/community/bareos/path-mounted.patch
+++ b/community/bareos/path-mounted.patch
@@ -1,6 +1,6 @@
--- a/core/src/lib/mntent_cache.cc
+++ b/core/src/lib/mntent_cache.cc
-@@ -54,6 +54,10 @@
+@@ -56,6 +56,10 @@
* Marco van Wieringen, August 2009
*/
@@ -10,4 +10,4 @@
+
#include "include/bareos.h"
#include "mntent_cache.h"
-
+ #include "lib/dlist.h"