diff options
Diffstat (limited to 'user/mosquitto')
-rw-r--r-- | user/mosquitto/APKBUILD | 40 | ||||
-rw-r--r-- | user/mosquitto/disable-flaky-test.patch | 11 | ||||
-rw-r--r-- | user/mosquitto/endian.patch | 169 | ||||
-rw-r--r-- | user/mosquitto/no-persist_read_test.patch | 15 | ||||
-rw-r--r-- | user/mosquitto/python3.patch | 48 |
5 files changed, 213 insertions, 70 deletions
diff --git a/user/mosquitto/APKBUILD b/user/mosquitto/APKBUILD index e7cd25057..4b7f6f06b 100644 --- a/user/mosquitto/APKBUILD +++ b/user/mosquitto/APKBUILD @@ -2,23 +2,24 @@ # Contributor: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Max Rees <maxcrees@me.com> pkgname=mosquitto -pkgver=1.6.6 +pkgver=2.0.15 pkgrel=0 pkgdesc="An Open Source MQTT Broker" url="https://mosquitto.org/" arch="all" license="EPL-1.0 AND EDL-1.0 AND MIT AND BSD-3-Clause" depends="" -makedepends="c-ares-dev openssl-dev util-linux-dev" -checkdepends="python3" +checkdepends="python3 ca-certificates cunit-dev" +makedepends="c-ares-dev openssl-dev util-linux-dev cjson-dev" subpackages="$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-openrc $pkgname-clients" install="$pkgname.pre-install" source="http://mosquitto.org/files/source/$pkgname-$pkgver.tar.gz mosquitto.initd - disable-flaky-test.patch openrc-conf.patch - python3.patch" + endian.patch + no-persist_read_test.patch + " # secfixes: # 1.6.6-r0: @@ -46,9 +47,26 @@ build() { } check() { - # Unit tests require cunit, so skip them. - make -j1 -C test/broker test - make -j1 -C test/lib test + # Explicitly disable tests, instead of enabling only good ones. + # 08-ssl-connect-cert-auth-without-py: #687 + # 06-bridge-reconnect-local-out.py: + # https://www.eclipse.org/lists/mosquitto-dev/msg02687.html + # (fix commit is not easily backported due to other churn) + # Other two: https://github.com/eclipse/mosquitto/issues/2550 + sed -i test/broker/test.py \ + -e '/08-ssl-connect-cert-auth-without.py/d' \ + -e '/06-bridge-b2br-late-connection-retain.py/d' \ + -e '/06-bridge-reconnect-local-out.py/d' \ + -e '/11-pub-props.py/d' \ + ; + sed -i test/lib/test.py \ + -e '/02-subscribe-qos1.py/d' \ + ; + sed -i test/client/Makefile \ + -e '/test.sh/d' \ + ; + # -j1 to avoid TLS errors on at least pmmx due to race. + make -j1 ptest } package() { @@ -73,8 +91,8 @@ clients() { mv "$pkgdir"/usr/bin/mosquitto_[ps]ub "$subpkgdir"/usr/bin/ } -sha512sums="ea6ba7b57773c8f4a59e708ae305a0e38ca85df94854410b29cccddbe10bbb91c2ea5e827fefb3f57cb4fce188ab9c3021804f1ae398b7fd5e9e965354b68bc1 mosquitto-1.6.6.tar.gz +sha512sums="8a0c58222ea0b9304e7f096f6d13965478072baf1d1c9bc931b32a33f5ea8196c2dd54bde8d83fec7ed9cd413cb5fb115ce0a6701ca20664df52fdd7ca63ddaf mosquitto-2.0.15.tar.gz 681fddc737b3ef3e6c052f0c854a730df290352640a18a63e23ef83d14c425558aff87805d1eb95e44de101b5df48872173af9f5414464ffa8cf727ea2c0491e mosquitto.initd -3886171e36f759a717aa6626d5b8dbd392963c737d5de28b4d52b81359008927b99ff7a0ca82f56a0e5deaed4585571759ba9216336a664fd346845837c2bc18 disable-flaky-test.patch b07f9bec2751ab32c43f53e74d8fca18dbf2d7ce7f8fab562dbcf75de19609ba6219d735ac504697404e0ed36613a14074e3a19e735297195877798f778d337a openrc-conf.patch -078197e6c3e59b664f5fdd1e4a4f669c9a76ab84fe4a5d8602ac80406b85c4e1cce29d9372e76d995155b74abb438d0dc0cdcdb98251fb904122073c4088d76a python3.patch" +89f738f77732500bc2aff3086b891c1e537510e756baf0ac92c1462c2ef7e47cdc62536d90174e6b6c80637199e463609723f9915999c0b95ce878ebbed739a1 endian.patch +b173f11e898bf2d882b7d833f99c863dc1fd14ee6f55484c29dafd067fa1af27ab85864df674c0a042547c5c132b80123d159f10e7bdab316a0292461b91fafd no-persist_read_test.patch" diff --git a/user/mosquitto/disable-flaky-test.patch b/user/mosquitto/disable-flaky-test.patch deleted file mode 100644 index 8fd51c403..000000000 --- a/user/mosquitto/disable-flaky-test.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- mosquitto-1.6.4/test/broker/Makefile 2019-08-01 19:50:01.000000000 +0000 -+++ mosquitto-1.6.4/test/broker/Makefile 2019-08-28 00:03:54.430562623 +0000 -@@ -193,7 +193,7 @@ endif - ./10-listener-mount-point.py - - 11 : -- ./11-message-expiry.py -+ #./11-message-expiry.py - ./11-persistent-subscription.py - ./11-persistent-subscription-v5.py - ./11-persistent-subscription-no-local.py diff --git a/user/mosquitto/endian.patch b/user/mosquitto/endian.patch new file mode 100644 index 000000000..2efd1111d --- /dev/null +++ b/user/mosquitto/endian.patch @@ -0,0 +1,169 @@ +From 165005742c1c6a5b0b6d037c9e83cbe4a18a3092 Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" <AWilcox@Wilcox-Tech.com> +Date: Sun, 29 May 2022 03:37:26 -0500 +Subject: [PATCH] persist: Fix ID storage on big-endian systems + +Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com> +--- + src/persist_read.c | 3 ++- + src/persist_read_v234.c | 5 ++++- + src/persist_read_v5.c | 4 ++++ + src/persist_write.c | 4 ++-- + src/persist_write_v5.c | 4 ++++ + 5 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/src/persist_read.c b/src/persist_read.c +index 5e7be454..e2b4ecb3 100644 +--- a/src/persist_read.c ++++ b/src/persist_read.c +@@ -24,6 +24,7 @@ Contributors: + #include <arpa/inet.h> + #endif + #include <assert.h> ++#include <endian.h> + #include <errno.h> + #include <fcntl.h> + #include <stdio.h> +@@ -480,7 +481,7 @@ int persist__restore(void) + fclose(fptr); + return 1; + } +- db.last_db_id = cfg_chunk.last_db_id; ++ db.last_db_id = le64toh(cfg_chunk.last_db_id); + break; + + case DB_CHUNK_MSG_STORE: +diff --git a/src/persist_read_v234.c b/src/persist_read_v234.c +index 7460c309..701d88d9 100644 +--- a/src/persist_read_v234.c ++++ b/src/persist_read_v234.c +@@ -24,6 +24,7 @@ Contributors: + #include <arpa/inet.h> + #endif + #include <assert.h> ++#include <endian.h> + #include <errno.h> + #include <fcntl.h> + #include <stdio.h> +@@ -108,6 +109,7 @@ int persist__chunk_client_msg_read_v234(FILE *db_fptr, struct P_client_msg *chun + } + + read_e(db_fptr, &chunk->F.store_id, sizeof(dbid_t)); ++ chunk->F.store_id = le64toh(chunk->F.store_id); + + read_e(db_fptr, &i16temp, sizeof(uint16_t)); + chunk->F.mid = ntohs(i16temp); +@@ -137,6 +139,7 @@ int persist__chunk_msg_store_read_v234(FILE *db_fptr, struct P_msg_store *chunk, + char *err; + + read_e(db_fptr, &chunk->F.store_id, sizeof(dbid_t)); ++ chunk->F.store_id = le64toh(chunk->F.store_id); + + rc = persist__read_string(db_fptr, &chunk->source.id); + if(rc){ +@@ -205,7 +208,7 @@ int persist__chunk_retain_read_v234(FILE *db_fptr, struct P_retain *chunk) + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", err); + return 1; + } +- chunk->F.store_id = i64temp; ++ chunk->F.store_id = le64toh(i64temp); + + return MOSQ_ERR_SUCCESS; + } +diff --git a/src/persist_read_v5.c b/src/persist_read_v5.c +index abc9a580..12d3e801 100644 +--- a/src/persist_read_v5.c ++++ b/src/persist_read_v5.c +@@ -24,6 +24,7 @@ Contributors: + #include <arpa/inet.h> + #endif + #include <assert.h> ++#include <endian.h> + #include <errno.h> + #include <fcntl.h> + #include <stdio.h> +@@ -116,6 +117,7 @@ int persist__chunk_client_msg_read_v56(FILE *db_fptr, struct P_client_msg *chunk + read_e(db_fptr, &chunk->F, sizeof(struct PF_client_msg)); + chunk->F.mid = ntohs(chunk->F.mid); + chunk->F.id_len = ntohs(chunk->F.id_len); ++ chunk->F.store_id = le64toh(chunk->F.store_id); + + length -= (uint32_t)(sizeof(struct PF_client_msg) + chunk->F.id_len); + +@@ -165,6 +167,7 @@ int persist__chunk_msg_store_read_v56(FILE *db_fptr, struct P_msg_store *chunk, + chunk->F.source_username_len = ntohs(chunk->F.source_username_len); + chunk->F.topic_len = ntohs(chunk->F.topic_len); + chunk->F.source_port = ntohs(chunk->F.source_port); ++ chunk->F.store_id = le64toh(chunk->F.store_id); + + length -= (uint32_t)(sizeof(struct PF_msg_store) + chunk->F.payloadlen + chunk->F.source_id_len + chunk->F.source_username_len + chunk->F.topic_len); + +@@ -246,6 +249,7 @@ int persist__chunk_retain_read_v56(FILE *db_fptr, struct P_retain *chunk) + log__printf(NULL, MOSQ_LOG_ERR, "Error: %s.", strerror(errno)); + return 1; + } ++ chunk->F.store_id = le64toh(chunk->F.store_id); + return MOSQ_ERR_SUCCESS; + } + +diff --git a/src/persist_write.c b/src/persist_write.c +index ccfbc29c..93a32639 100644 +--- a/src/persist_write.c ++++ b/src/persist_write.c +@@ -273,7 +273,7 @@ static int persist__retain_save(FILE *db_fptr, struct mosquitto__retainhier *nod + + if(node->retained && strncmp(node->retained->topic, "$SYS", 4)){ + /* Don't save $SYS messages. */ +- retain_chunk.F.store_id = node->retained->db_id; ++ retain_chunk.F.store_id = htole64(node->retained->db_id); + rc = persist__chunk_retain_write_v6(db_fptr, &retain_chunk); + if(rc){ + return rc; +@@ -367,7 +367,7 @@ int persist__backup(bool shutdown) + write_e(db_fptr, &db_version_w, sizeof(uint32_t)); + + memset(&cfg_chunk, 0, sizeof(struct PF_cfg)); +- cfg_chunk.last_db_id = db.last_db_id; ++ cfg_chunk.last_db_id = htole64(db.last_db_id); + cfg_chunk.shutdown = shutdown; + cfg_chunk.dbid_size = sizeof(dbid_t); + if(persist__chunk_cfg_write_v6(db_fptr, &cfg_chunk)){ +diff --git a/src/persist_write_v5.c b/src/persist_write_v5.c +index 8c9f6c34..b9fb5a8e 100644 +--- a/src/persist_write_v5.c ++++ b/src/persist_write_v5.c +@@ -24,6 +24,7 @@ Contributors: + #include <arpa/inet.h> + #endif + #include <assert.h> ++#include <endian.h> + #include <errno.h> + #include <fcntl.h> + #include <stdio.h> +@@ -100,6 +101,7 @@ int persist__chunk_client_msg_write_v6(FILE *db_fptr, struct P_client_msg *chunk + + chunk->F.mid = htons(chunk->F.mid); + chunk->F.id_len = htons(chunk->F.id_len); ++ chunk->F.store_id = htole64(chunk->F.store_id); + + header.chunk = htonl(DB_CHUNK_CLIENT_MSG); + header.length = htonl((uint32_t)sizeof(struct PF_client_msg) + id_len + proplen); +@@ -149,6 +151,7 @@ int persist__chunk_message_store_write_v6(FILE *db_fptr, struct P_msg_store *chu + proplen += property__get_remaining_length(chunk->properties); + } + ++ chunk->F.store_id = htole64(chunk->F.store_id); + chunk->F.payloadlen = htonl(chunk->F.payloadlen); + chunk->F.source_mid = htons(chunk->F.source_mid); + chunk->F.source_id_len = htons(chunk->F.source_id_len); +@@ -206,6 +209,7 @@ int persist__chunk_retain_write_v6(FILE *db_fptr, struct P_retain *chunk) + + header.chunk = htonl(DB_CHUNK_RETAIN); + header.length = htonl((uint32_t)sizeof(struct PF_retain)); ++ chunk->F.store_id = htole64(chunk->F.store_id); + + write_e(db_fptr, &header, sizeof(struct PF_header)); + write_e(db_fptr, &chunk->F, sizeof(struct PF_retain)); +-- +2.35.1 + diff --git a/user/mosquitto/no-persist_read_test.patch b/user/mosquitto/no-persist_read_test.patch new file mode 100644 index 000000000..6227e0487 --- /dev/null +++ b/user/mosquitto/no-persist_read_test.patch @@ -0,0 +1,15 @@ +This doesn't pass on 32-bit platforms as noted upstream at: +https://github.com/eclipse/mosquitto/issues/2550 + +We disable these tests for now. + +--- mosquitto-2.0.14/test/unit/Makefile.old 2021-11-16 18:28:35.000000000 -0600 ++++ mosquitto-2.0.14/test/unit/Makefile 2022-11-22 00:37:32.237485238 -0600 +@@ -174,7 +174,5 @@ + + test-broker : build + ./bridge_topic_test +- ./persist_read_test +- ./persist_write_test + ./subs_test + diff --git a/user/mosquitto/python3.patch b/user/mosquitto/python3.patch deleted file mode 100644 index f348cbc3e..000000000 --- a/user/mosquitto/python3.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- mosquitto-1.6.4/test/broker/09-extended-auth-change-username.py.old 2019-08-01 19:50:01.000000000 +0000 -+++ mosquitto-1.6.4/test/broker/09-extended-auth-change-username.py 2019-08-27 22:20:08.560518752 +0000 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - # Check whether an extended auth plugin can change the username of a client. - ---- mosquitto-1.6.4/test/broker/09-extended-auth-multistep-reauth.py.old 2019-08-01 19:50:01.000000000 +0000 -+++ mosquitto-1.6.4/test/broker/09-extended-auth-multistep-reauth.py 2019-08-27 22:22:11.530519618 +0000 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - from mosq_test_helper import * - ---- mosquitto-1.6.4/test/broker/09-extended-auth-multistep.py.old 2019-08-01 19:50:01.000000000 +0000 -+++ mosquitto-1.6.4/test/broker/09-extended-auth-multistep.py 2019-08-27 22:20:37.030518952 +0000 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - from mosq_test_helper import * - ---- mosquitto-1.6.4/test/broker/09-extended-auth-single.py.old 2019-08-01 19:50:01.000000000 +0000 -+++ mosquitto-1.6.4/test/broker/09-extended-auth-single.py 2019-08-27 22:21:42.250519412 +0000 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - # Multi tests for extended auth with a single step. - # * Error in plugin ---- mosquitto-1.6.4/test/broker/09-extended-auth-single2.py.old 2019-08-01 19:50:01.000000000 +0000 -+++ mosquitto-1.6.4/test/broker/09-extended-auth-single2.py 2019-08-27 22:21:02.220519130 +0000 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - # Multi tests for extended auth with a single step - multiple plugins at once. - # * Error in plugin ---- mosquitto-1.6.4/test/broker/09-extended-auth-unsupported.py.old 2019-08-01 19:50:01.000000000 +0000 -+++ mosquitto-1.6.4/test/broker/09-extended-auth-unsupported.py 2019-08-27 22:21:20.360519257 +0000 -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - # Test whether an unsupported extended auth is rejected. - |