update to mosquitto-1.6.7

This commit is contained in:
jasper 2019-11-13 20:53:32 +00:00
parent 63d051973c
commit b4b268bffa
14 changed files with 38 additions and 276 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.26 2019/07/12 20:48:32 sthen Exp $
# $OpenBSD: Makefile,v 1.27 2019/11/13 20:53:32 jasper Exp $
COMMENT = opensource MQTT broker
DISTNAME = mosquitto-1.5.8
DISTNAME = mosquitto-1.6.7
SHARED_LIBS += mosquitto 0.0 # 1.5
SHARED_LIBS += mosquittopp 0.0 # 1.5
SHARED_LIBS += mosquitto 1.0 # 1.5
SHARED_LIBS += mosquittopp 1.0 # 1.5
CATEGORIES = net
HOMEPAGE = https://mosquitto.org/

View File

@ -1,2 +1,2 @@
SHA256 (mosquitto-1.5.8.tar.gz) = eNfnDDeU3DodSEtPL4063evpwto/Whzr5Vf30TvrDaQ=
SIZE (mosquitto-1.5.8.tar.gz) = 442834
SHA256 (mosquitto-1.6.7.tar.gz) = vNMaj7vQU/7jKJhvrdhmbTBYNX3tVrl4L31PGZMdF44=
SIZE (mosquitto-1.6.7.tar.gz) = 591062

View File

@ -1,27 +0,0 @@
$OpenBSD: patch-CMakeLists_txt,v 1.3 2018/06/03 14:20:43 jasper Exp $
Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -30,19 +30,14 @@ if (WIN32)
else (WIN32)
set (BINDIR bin)
set (SBINDIR sbin)
- if ("${CMAKE_INSTALL_PREFIX}" STREQUAL /usr)
- set (SYSCONFDIR /etc/mosquitto)
- else ("${CMAKE_INSTALL_PREFIX}" STREQUAL /usr)
- set (SYSCONFDIR etc/mosquitto)
- endif ("${CMAKE_INSTALL_PREFIX}" STREQUAL /usr)
set (LIBDIR lib${LIB_SUFFIX})
- set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBDIR}")
set (INCLUDEDIR include)
set (DATAROOTDIR share)
- set (MANDIR "${DATAROOTDIR}/man")
+ set (MANDIR "man")
set (SHAREDIR "${DATAROOTDIR}/mosquitto")
set (PKGCONFIGDIR "${LIBDIR}/pkgconfig")
+ set (SYSCONFDIR "${DATAROOTDIR}/examples/mosquitto")
endif (WIN32)
option(WITH_TLS

View File

@ -1,28 +1,18 @@
$OpenBSD: patch-lib_CMakeLists_txt,v 1.7 2019/02/12 19:18:41 jasper Exp $
$OpenBSD: patch-lib_CMakeLists_txt,v 1.8 2019/11/13 20:53:32 jasper Exp $
Index: lib/CMakeLists.txt
--- lib/CMakeLists.txt.orig
+++ lib/CMakeLists.txt
@@ -84,6 +84,12 @@ set_target_properties(libmosquitto PROPERTIES
@@ -87,6 +87,12 @@ set_target_properties(libmosquitto PROPERTIES
SOVERSION 1
)
+include(CheckSymbolExists)
+CHECK_SYMBOL_EXISTS(arc4random_uniform stdlib.h ARC4RANDOM_UNIFORM)
+if (${ARC4RANDOM_UNIFORM})
+ add_definitions("-DWITH_ARC4RANDOM")
+ add_definitions("-DWITH_ARC4RANDOM")
+endif (${ARC4RANDOM_UNIFORM})
+
install(TARGETS libmosquitto RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
install(TARGETS libmosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
if (WITH_STATIC_LIBRARIES)
@@ -107,7 +113,7 @@ endif (WITH_STATIC_LIBRARIES)
install(FILES mosquitto.h DESTINATION "${INCLUDEDIR}")
-if (UNIX AND NOT APPLE)
+if (UNIX AND NOT APPLE AND NOT (CMAKE_SYSTEM_NAME MATCHES "OpenBSD"))
install(CODE "EXEC_PROGRAM(/sbin/ldconfig)")
-endif (UNIX AND NOT APPLE)
+endif (UNIX AND NOT APPLE AND NOT (CMAKE_SYSTEM_NAME MATCHES "OpenBSD"))

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-lib_cpp_CMakeLists_txt,v 1.4 2019/02/12 19:18:41 jasper Exp $
Index: lib/cpp/CMakeLists.txt
--- lib/cpp/CMakeLists.txt.orig
+++ lib/cpp/CMakeLists.txt
@@ -39,7 +39,7 @@ endif (WITH_STATIC_LIBRARIES)
install(FILES mosquittopp.h DESTINATION "${INCLUDEDIR}")
-if (UNIX AND NOT APPLE)
+if (UNIX AND NOT APPLE AND NOT (CMAKE_SYSTEM_NAME MATCHES "OpenBSD"))
install(CODE "EXEC_PROGRAM(/sbin/ldconfig)")
-endif (UNIX AND NOT APPLE)
+endif (UNIX AND NOT APPLE AND NOT (CMAKE_SYSTEM_NAME MATCHES "OpenBSD"))

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-lib_mosquitto_c,v 1.3 2019/03/07 19:41:18 jasper Exp $
$OpenBSD: patch-lib_mosquitto_c,v 1.4 2019/11/13 20:53:32 jasper Exp $
Index: lib/mosquitto.c
--- lib/mosquitto.c.orig
+++ lib/mosquitto.c
@@ -22,6 +22,9 @@ Contributors:
#ifndef WIN32
@@ -23,6 +23,9 @@ Contributors:
#include <sys/time.h>
#include <strings.h>
#endif
+#ifdef WITH_ARC4RANDOM
+#include <stdlib.h>
@ -13,7 +13,7 @@ Index: lib/mosquitto.c
#include "mosquitto.h"
#include "mosquitto_internal.h"
@@ -44,6 +47,7 @@ int mosquitto_lib_version(int *major, int *minor, int
@@ -46,6 +49,7 @@ int mosquitto_lib_version(int *major, int *minor, int
int mosquitto_lib_init(void)
{
@ -21,23 +21,11 @@ Index: lib/mosquitto.c
#ifdef WIN32
srand(GetTickCount64());
#elif _POSIX_TIMERS>0 && defined(_POSIX_MONOTONIC_CLOCK)
@@ -62,6 +66,7 @@ int mosquitto_lib_init(void)
@@ -63,6 +67,7 @@ int mosquitto_lib_init(void)
gettimeofday(&tv, NULL);
srand(tv.tv_sec*1000 + tv.tv_usec/1000);
#endif
+#endif
#endif
return net__init();
}
@@ -155,7 +160,11 @@ int mosquitto_reinitialise(struct mosquitto *mosq, con
mosq->id[4] = '/';
for(i=5; i<23; i++){
+#ifdef WITH_ARC4RANDOM
+ mosq->id[i] = arc4random_uniform(73)+48;
+#else
mosq->id[i] = (rand()%73)+48;
+#endif
}
}
mosq->in_packet.payload = NULL;

View File

@ -1,27 +1,27 @@
$OpenBSD: patch-mosquitto_conf,v 1.5 2019/02/12 19:18:41 jasper Exp $
$OpenBSD: patch-mosquitto_conf,v 1.6 2019/11/13 20:53:32 jasper Exp $
Index: mosquitto.conf
--- mosquitto.conf.orig
+++ mosquitto.conf
@@ -28,7 +28,7 @@
@@ -158,7 +158,7 @@
# This should be set to /var/run/mosquitto.pid if mosquitto is
# being run automatically on boot with an init script and
# being run automatically on boot with an init script and
# start-stop-daemon or similar.
-#pid_file
+pid_file /var/run/mosquitto.pid
# When run as root, drop privileges to this user and its primary
# group.
@@ -36,7 +36,7 @@
# Set to true to queue messages with QoS 0 when a persistent client is
# disconnected. These messages are included in the limit imposed by
@@ -195,7 +195,7 @@
# If run as a non-root user, this setting has no effect.
# Note that on Windows this has no effect and so mosquitto should
# Note that on Windows this has no effect and so mosquitto should
# be started by the user you wish it to run as.
-#user mosquitto
+user _mosquitto
# The maximum number of QoS 1 and 2 messages currently inflight per
# client.
@@ -170,7 +170,7 @@
# given, the default listener will not be bound to a specific
# =================================================================
# Default listener
@@ -205,7 +205,7 @@
# given, the default listener will not be bound to a specific
# address and so will be accessible to all network interfaces.
# bind_address ip-address/host name
-#bind_address
@ -29,12 +29,12 @@ Index: mosquitto.conf
# Port to use for the default listener.
#port 1883
@@ -507,7 +507,7 @@
@@ -585,7 +585,7 @@
# Note that if the broker is running as a Windows service it will default to
# "log_dest none" and neither stdout nor stderr logging is available.
# Use "log_dest none" if you wish to disable logging.
-#log_dest stderr
+log_dest syslog
# If using syslog logging (not on Windows), messages will be logged to the
# "daemon" facility by default. Use the log_facility option to choose which of
# Types of messages to log. Use multiple log_type lines for logging
# multiple types of messages.

View File

@ -1,9 +1,9 @@
$OpenBSD: patch-src_CMakeLists_txt,v 1.8 2019/02/12 19:18:41 jasper Exp $
$OpenBSD: patch-src_CMakeLists_txt,v 1.9 2019/11/13 20:53:32 jasper Exp $
Index: src/CMakeLists.txt
--- src/CMakeLists.txt.orig
+++ src/CMakeLists.txt
@@ -129,6 +129,8 @@ endif (HAVE_GETADDRINFO_A)
@@ -146,6 +146,8 @@ endif (HAVE_GETADDRINFO_A)
if (UNIX)
if (APPLE)
set (MOSQ_LIBS ${MOSQ_LIBS} dl m)
@ -12,40 +12,3 @@ Index: src/CMakeLists.txt
elseif(QNX)
set(MOSQ_LIBS ${MOSQ_LIBS} m socket)
else(APPLE)
@@ -156,14 +158,22 @@ if (WITH_WEBSOCKETS)
endif (STATIC_WEBSOCKETS)
endif (WITH_WEBSOCKETS)
+# DCE 1.1 RPC uuid functions
+include(CheckSymbolExists)
+CHECK_SYMBOL_EXISTS(uuid_create uuid.h UUID_CREATE)
+if (UUID_CREATE)
+ add_definitions(-DWITH_UUID_CREATE)
+endif (UUID_CREATE)
+
# Simple detect libuuid
-if(NOT APPLE)
+if(NOT UUID_CREATE)
FIND_PATH(UUID_HEADER uuid/uuid.h)
- if (UUID_HEADER)
+ FIND_LIBRARY(UUID_LIBRARY NAMES uuid)
+ if (UUID_HEADER AND UUID_LIBRARY)
add_definitions(-DWITH_UUID)
- set (MOSQ_LIBS ${MOSQ_LIBS} uuid)
- endif (UUID_HEADER)
-endif(NOT APPLE)
+ set (MOSQ_LIBS ${MOSQ_LIBS} ${UUID_LIBRARY})
+ endif()
+endif(NOT UUID_CREATE)
add_executable(mosquitto ${MOSQ_SRCS})
target_link_libraries(mosquitto ${MOSQ_LIBS})
@@ -185,6 +195,6 @@ if (WITH_TLS)
install(TARGETS mosquitto_passwd RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}")
endif (WITH_TLS)
-if (UNIX AND NOT APPLE)
+if (UNIX AND NOT APPLE AND NOT (CMAKE_SYSTEM_NAME MATCHES "OpenBSD"))
install(CODE "EXEC_PROGRAM(/sbin/ldconfig)")
-endif (UNIX AND NOT APPLE)
+endif (UNIX AND NOT APPLE AND NOT (CMAKE_SYSTEM_NAME MATCHES "OpenBSD"))

View File

@ -1,56 +0,0 @@
$OpenBSD: patch-src_handle_connect_c,v 1.1 2018/06/03 14:20:43 jasper Exp $
Index: src/handle_connect.c
--- src/handle_connect.c.orig
+++ src/handle_connect.c
@@ -29,7 +29,9 @@ Contributors:
#include "tls_mosq.h"
#include "util_mosq.h"
-#ifdef WITH_UUID
+#if defined(WITH_UUID_CREATE)
+# include <uuid.h>
+#elif defined(WITH_UUID)
# include <uuid/uuid.h>
#endif
@@ -40,13 +42,17 @@ Contributors:
static char *client_id_gen(struct mosquitto_db *db, int *idlen, const char *auto_id_prefix, int auto_id_prefix_len)
{
char *client_id;
-#ifdef WITH_UUID
+#if defined(WITH_UUID_CREATE)
uuid_t uuid;
+ uint32_t status;
+ char *out;
+#elif defined(WITH_UUID)
+ uuid_t uuid;
#else
int i;
#endif
-#ifdef WITH_UUID
+#if defined(WITH_UUID) || defined(WITH_UUID_CREATE)
*idlen = 36 + auto_id_prefix_len;
#else
*idlen = 64 + auto_id_prefix_len;
@@ -61,7 +67,18 @@ static char *client_id_gen(struct mosquitto_db *db, in
}
-#ifdef WITH_UUID
+#if defined(WITH_UUID_CREATE)
+ uuid_create(&uuid, &status);
+ if (status != uuid_s_ok){
+ return NULL;
+ }
+ uuid_to_string(&uuid, &out, &status);
+ if (status != uuid_s_ok){
+ return NULL;
+ }
+ memcpy(&client_id[auto_id_prefix_len], out, UUID_STR_LEN + 1);
+ free(out);
+#elif defined(WITH_UUID)
uuid_generate_random(uuid);
uuid_unparse_lower(uuid, &client_id[auto_id_prefix_len]);
#else

View File

@ -1,42 +0,0 @@
$OpenBSD: patch-test_Makefile,v 1.2 2018/06/03 14:20:43 jasper Exp $
Index: test/Makefile
--- test/Makefile.orig
+++ test/Makefile
@@ -20,32 +20,32 @@ ptest :
$(MAKE) -C lib ptest
fake_user : fake_user.o
- ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION}
+ ${CC} $^ -o $@ ${WRKLIB}
#${CC} $^ -o $@ -lmosquitto
fake_user.o : fake_user.c
${CC} $(CFLAGS) -c $< -o $@
msgsps_pub : msgsps_pub.o
- ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION}
+ ${CC} $^ -o $@ ${WRKLIB}
msgsps_pub.o : msgsps_pub.c msgsps_common.h
${CC} $(CFLAGS) -c $< -o $@
msgsps_sub : msgsps_sub.o
- ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION}
+ ${CC} $^ -o $@ ${WRKLIB}
msgsps_sub.o : msgsps_sub.c msgsps_common.h
${CC} $(CFLAGS) -c $< -o $@
packet-gen : packet-gen.o
- ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION}
+ ${CC} $^ -o $@ ${WRKLIB}
packet-gen.o : packet-gen.c
${CC} $(CFLAGS) -c $< -o $@
qos : qos.o
- ${CC} $^ -o $@ ../lib/libmosquitto.so.${SOVERSION}
+ ${CC} $^ -o $@ ${WRKLIB}
qos.o : qos.c
${CC} $(CFLAGS) -c $< -o $@

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-test_broker_c_Makefile,v 1.4 2019/01/07 18:36:44 jasper Exp $
Index: test/broker/c/Makefile
--- test/broker/c/Makefile.orig
+++ test/broker/c/Makefile
@@ -38,10 +38,10 @@ auth_plugin_acl_sub_denied.so : auth_plugin_acl_sub_de
$(CC) ${CFLAGS} -fPIC -shared $^ -o $@
08-tls-psk-pub.test : 08-tls-psk-pub.c
- $(CC) ${CFLAGS} $^ -o $@ ../../../lib/libmosquitto.so.1
+ $(CC) ${CFLAGS} $^ -o $@ ${WRKLIB}
08-tls-psk-bridge.test : 08-tls-psk-bridge.c
- $(CC) ${CFLAGS} $^ -o $@ ../../../lib/libmosquitto.so.1
+ $(CC) ${CFLAGS} $^ -o $@ ${WRKLIB}
reallyclean : clean

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-test_lib_c_Makefile,v 1.1 2017/04/15 20:46:16 sthen Exp $
--- test/lib/c/Makefile.orig Fri Apr 14 15:04:30 2017
+++ test/lib/c/Makefile Fri Apr 14 15:04:38 2017
@@ -1,7 +1,7 @@
.PHONY: all test 01 02 03 04 08 09 clean reallyclean
CFLAGS=-I../../../lib -Werror
-LIBS=../../../lib/libmosquitto.so.1
+LIBS=${WRKLIB}
all : 01 02 03 04 08 09

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-test_lib_cpp_Makefile,v 1.1 2017/04/15 20:46:16 sthen Exp $
--- test/lib/cpp/Makefile.orig Fri Apr 14 15:04:53 2017
+++ test/lib/cpp/Makefile Fri Apr 14 15:05:10 2017
@@ -1,7 +1,7 @@
.PHONY: all test 01 02 03 04 08 09 clean reallyclean
CFLAGS=-I../../../lib -I../../../lib/cpp -DDEBUG -Werror
-LIBS=../../../lib/libmosquitto.so.1 ../../../lib/cpp/libmosquittopp.so.1
+LIBS=${WRKLIB} ${WRKLIBPP}
all : 01 02 03 04 08 09

View File

@ -1,9 +1,10 @@
@comment $OpenBSD: PLIST,v 1.3 2018/06/03 14:20:43 jasper Exp $
@comment $OpenBSD: PLIST,v 1.4 2019/11/13 20:53:32 jasper Exp $
@newgroup _mosquitto:753
@newuser _mosquitto:753:753:daemon:Mosquitto MQTT Broker:/var/empty:/sbin/nologin
@rcscript ${RCDIR}/mosquitto
@bin bin/mosquitto_passwd
@bin bin/mosquitto_pub
@bin bin/mosquitto_rr
@bin bin/mosquitto_sub
include/mosquitto.h
include/mosquitto_broker.h
@ -11,10 +12,9 @@ include/mosquitto_plugin.h
include/mosquittopp.h
@lib lib/libmosquitto.so.${LIBmosquitto_VERSION}
@lib lib/libmosquittopp.so.${LIBmosquittopp_VERSION}
lib/pkgconfig/libmosquitto.pc
lib/pkgconfig/libmosquittopp.pc
@man man/man1/mosquitto_passwd.1
@man man/man1/mosquitto_pub.1
@man man/man1/mosquitto_rr.1
@man man/man1/mosquitto_sub.1
@man man/man3/libmosquitto.3
@man man/man5/mosquitto.conf.5
@ -33,3 +33,5 @@ share/examples/mosquitto/mosquitto.conf
@group
share/examples/mosquitto/pskfile.example
share/examples/mosquitto/pwfile.example
share/pkgconfig/libmosquitto.pc
share/pkgconfig/libmosquittopp.pc