From 385a725c1cec23f50e2093bdf2ad60fa97b22b73 Mon Sep 17 00:00:00 2001 From: Nathan Owens Date: Wed, 18 Nov 2020 18:30:38 -0600 Subject: [PATCH] mosquitto: update to 1.6.12 Fixes CVE-2019-11778 CVE-2019-11779 --- srcpkgs/mosquitto/patches/0001-Fix-test.patch | 202 ++++++++++++++++++ srcpkgs/mosquitto/template | 27 +-- 2 files changed, 210 insertions(+), 19 deletions(-) create mode 100644 srcpkgs/mosquitto/patches/0001-Fix-test.patch diff --git a/srcpkgs/mosquitto/patches/0001-Fix-test.patch b/srcpkgs/mosquitto/patches/0001-Fix-test.patch new file mode 100644 index 00000000000..49bd3a4861b --- /dev/null +++ b/srcpkgs/mosquitto/patches/0001-Fix-test.patch @@ -0,0 +1,202 @@ +From cc14b62918788f0eb0c2fcb29665d8da80780cc3 Mon Sep 17 00:00:00 2001 +From: Nathan Owens +Date: Wed, 18 Nov 2020 19:58:41 -0600 +Subject: [PATCH] Fix test + +--- + test/unit/datatype_read.c | 4 ++-- + test/unit/datatype_write.c | 4 ++-- + test/unit/misc_trim_test.c | 4 ++-- + test/unit/persist_read_test.c | 4 ++-- + test/unit/persist_write_test.c | 4 ++-- + test/unit/property_add.c | 4 ++-- + test/unit/property_read.c | 4 ++-- + test/unit/property_user_read.c | 4 ++-- + test/unit/property_write.c | 4 ++-- + test/unit/publish_test.c | 4 ++-- + test/unit/test.c | 4 ++-- + test/unit/utf8.c | 4 ++-- + test/unit/util_topic_test.c | 4 ++-- + 13 files changed, 26 insertions(+), 26 deletions(-) + +diff --git test/unit/datatype_read.c test/unit/datatype_read.c +index 6001cbe..8224bd4 100644 +--- test/unit/datatype_read.c ++++ test/unit/datatype_read.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include "packet_mosq.h" + +diff --git test/unit/datatype_write.c test/unit/datatype_write.c +index 9fb9a5b..ad37d7a 100644 +--- test/unit/datatype_write.c ++++ test/unit/datatype_write.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include + +diff --git test/unit/misc_trim_test.c test/unit/misc_trim_test.c +index 2916bce..d073e53 100644 +--- test/unit/misc_trim_test.c ++++ test/unit/misc_trim_test.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include + +diff --git test/unit/persist_read_test.c test/unit/persist_read_test.c +index 84c36c0..b4b6849 100644 +--- test/unit/persist_read_test.c ++++ test/unit/persist_read_test.c +@@ -3,8 +3,8 @@ + * FIXME - these need to be aggressive about finding failures, at the moment + * they are just confirming that good behaviour works. */ + +-#include +-#include ++#include ++#include + + #define WITH_BROKER + #define WITH_PERSISTENCE +diff --git test/unit/persist_write_test.c test/unit/persist_write_test.c +index 16e422d..02e1dfa 100644 +--- test/unit/persist_write_test.c ++++ test/unit/persist_write_test.c +@@ -3,8 +3,8 @@ + * FIXME - these need to be aggressive about finding failures, at the moment + * they are just confirming that good behaviour works. */ + +-#include +-#include ++#include ++#include + + #define WITH_BROKER + #define WITH_PERSISTENCE +diff --git test/unit/property_add.c test/unit/property_add.c +index 341c008..b298550 100644 +--- test/unit/property_add.c ++++ test/unit/property_add.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include "mqtt_protocol.h" + #include "property_mosq.h" +diff --git test/unit/property_read.c test/unit/property_read.c +index e305bf3..f8fec43 100644 +--- test/unit/property_read.c ++++ test/unit/property_read.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include "mqtt_protocol.h" + #include "property_mosq.h" +diff --git test/unit/property_user_read.c test/unit/property_user_read.c +index 902296b..f7efa74 100644 +--- test/unit/property_user_read.c ++++ test/unit/property_user_read.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include "mqtt_protocol.h" + #include "property_mosq.h" +diff --git test/unit/property_write.c test/unit/property_write.c +index 2618fee..205ace0 100644 +--- test/unit/property_write.c ++++ test/unit/property_write.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include "mqtt_protocol.h" + #include "property_mosq.h" +diff --git test/unit/publish_test.c test/unit/publish_test.c +index 6371db3..675625b 100644 +--- test/unit/publish_test.c ++++ test/unit/publish_test.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include + #include +diff --git test/unit/test.c test/unit/test.c +index 97258c4..b7f991d 100644 +--- test/unit/test.c ++++ test/unit/test.c +@@ -1,8 +1,8 @@ + #include "config.h" + #include + +-#include +-#include ++#include ++#include + + int init_datatype_read_tests(void); + int init_datatype_write_tests(void); +diff --git test/unit/utf8.c test/unit/utf8.c +index 1982da8..9d2bd64 100644 +--- test/unit/utf8.c ++++ test/unit/utf8.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include "mosquitto.h" + +diff --git test/unit/util_topic_test.c test/unit/util_topic_test.c +index b669fcc..cda0b8e 100644 +--- test/unit/util_topic_test.c ++++ test/unit/util_topic_test.c +@@ -1,5 +1,5 @@ +-#include +-#include ++#include ++#include + + #include + +-- +2.29.2 + +diff --git test/unit/Makefile test/unit/Makefile +index 6086028..81519db 100644 +--- test/unit/Makefile ++++ test/unit/Makefile +@@ -9,7 +9,7 @@ endif + + CFLAGS:=$(CFLAGS) -coverage -Wall -ggdb + LDFLAGS:=$(LDFLAGS) -coverage +-LDADD:=$(LDADD) -lcunit ++LDADD:=$(LDADD) -lbcunit + + TEST_OBJS = test.o \ + datatype_read.o \ diff --git a/srcpkgs/mosquitto/template b/srcpkgs/mosquitto/template index 2f4ac6ccda2..513f63c2d14 100644 --- a/srcpkgs/mosquitto/template +++ b/srcpkgs/mosquitto/template @@ -1,20 +1,20 @@ # Template file for 'mosquitto' pkgname=mosquitto -version=1.6.3 -revision=4 -build_style=gnu-makefile +version=1.6.12 +revision=1 +build_style=cmake +configure_args="-DCMAKE_INSTALL_SYSCONFDIR=/etc" make_build_args="WITH_TLS_PSK=no WITH_WEBSOCKETS=yes" # PSK not supported by libressl make_install_args="prefix=/usr" -make_check_target=test conf_files="/etc/mosquitto/mosquitto.conf" makedepends="c-ares-devel libressl-devel libwebsockets-devel libuv-devel" -checkdepends="python bcunit-devel" +checkdepends="python3 bcunit-devel" short_desc="MQTT version 3.1/3.1.1/5.0 compatible message broker" maintainer="Lukas Braun " license="EPL-1.0, BSD-3-Clause-Attribution" homepage="https://mosquitto.org" distfiles="${homepage}/files/source/${pkgname}-${version}.tar.gz" -checksum=9ef5cc75f4fe31d7bf50654ddf4728ad9e1ae2e5609a4b42ecbbcb4a209ed17e +checksum=548d73d19fb787dd0530334e398fd256ef3a581181678488a741a995c4f007fb system_accounts="_mosquitto" _mosquitto_homedir="/var/lib/mosquitto" @@ -22,23 +22,12 @@ make_dirs="/var/lib/mosquitto 0755 ${system_accounts} ${system_accounts}" CFLAGS="-fcommon" -post_extract() { - case "$XBPS_TARGET_MACHINE" in - *-musl) - post_extract() { - vsed -e 's/-lanl//' -i config.mk - } - esac -} - -pre_install() { - sed -i 's,sbin,bin,g' */Makefile +do_check() { + make -C test/unit test } post_install() { vlicense edl-v10 LICENSE - mv ${DESTDIR}/etc/${pkgname}/${pkgname}.conf.example \ - ${DESTDIR}/etc/${pkgname}/${pkgname}.conf vmkdir usr/share/examples/${pkgname} mv ${DESTDIR}/etc/${pkgname}/*.example \ ${DESTDIR}/usr/share/examples/${pkgname}