diff --git a/CMakeLists.txt b/CMakeLists.txt index 71da9768..9167f9e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,16 +4,13 @@ # To configure the build options either use the CMake gui, or run the command # line utility including the "-i" option. -set(CMAKE_LEGACY_CYGWIN_WIN32 0) - -project(mosquitto) - cmake_minimum_required(VERSION 3.0) cmake_policy(SET CMP0042 NEW) -set (VERSION 2.0.2) +project(mosquitto) +set (VERSION 2.0.3) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/") add_definitions (-DCMAKE -DVERSION=\"${VERSION}\") diff --git a/ChangeLog.txt b/ChangeLog.txt index 14bc5086..1d6ae289 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,37 @@ +2.0.3 - 2020-12-17 +================== + +Security: +- Running mosquitto_passwd with the following arguments only + `mosquitto_passwd -b password_file username password` would cause the + username to be used as the password. + +Broker: +- Fix excessive CPU use on non-Linux systems when the open file limit is set + high. Closes #1947. +- Fix LWT not being sent on client takeover when the existing session wasn't + being continued. Closes #1946. +- Fix bridges possibly not completing connections when WITH_ADNS is in use. + Closes #1960. +- Fix QoS 0 messages not being delivered if max_queued_messages was set to 0. + Closes #1956. +- Fix local bridges being disconnected on SIGHUP. Closes #1942. +- Fix slow initial bridge connections for WITH_ADNS=no. +- Fix persistence_location not appending a '/'. + +Clients: +- Fix mosquitto_sub being unable to terminate with Ctrl-C if a successful + connection is not made. Closes #1957. + +Apps: +- Fix `mosquitto_passwd -b` using username as password (not if `-c` is also + used). Closes #1949. + +Build: +- Fix `install` target when using WITH_CJSON=no. Closes #1938. +- Fix `generic` docker build. Closes #1945. + + 2.0.2 - 2020-12-10 ================== @@ -101,8 +135,8 @@ Broker features: to a v3.x only broker. - DLT logging is now configurable at runtime with `log_dest dlt`. Closes #1735. -- Add `mosquitto_plugin_publish()` function, which can be used by plugins to - publish messages. +- Add `mosquitto_broker_publish()` and `mosquitto_broker_publish_copy()` + functions, which can be used by plugins to publish messages. - Add `mosquitto_client_protocol_version()` function which can be used by plugins to determine which version of MQTT a client has connected with. - Add `mosquitto_kick_client_by_clientid()` and `mosquitto_kick_client_by_username()` diff --git a/apps/mosquitto_ctrl/Makefile b/apps/mosquitto_ctrl/Makefile index 3a4843bf..c351f9b9 100644 --- a/apps/mosquitto_ctrl/Makefile +++ b/apps/mosquitto_ctrl/Makefile @@ -36,9 +36,9 @@ else TARGET:= endif -all : $(TARGET) +all : ${TARGET} -mosquitto_ctrl : ${OBJS} +mosquitto_ctrl : ${OBJS} ${LIBMOSQ} ${CROSS_COMPILE}${CC} ${APP_LDFLAGS} $^ -o $@ $(PASSWD_LDADD) $(LOCAL_LDFLAGS) $(LIBMOSQ) -lcjson -ldl mosquitto_ctrl_example.so : ${EXAMPLE_OBJS} @@ -83,9 +83,19 @@ misc_mosq.o : ../../lib/misc_mosq.c ../../lib/misc_mosq.h password_mosq.o : ../../src/password_mosq.c ../../src/password_mosq.h ${CROSS_COMPILE}${CC} $(APP_CPPFLAGS) $(APP_CFLAGS) -c $< -o $@ +../../lib/libmosquitto.so.${SOVERSION} : + $(MAKE) -C ../../lib + +../../lib/libmosquitto.a : + $(MAKE) -C ../../lib libmosquitto.a + install : all +ifeq ($(WITH_TLS),yes) +ifeq ($(WITH_CJSON),yes) $(INSTALL) -d "${DESTDIR}$(prefix)/bin" $(INSTALL) ${STRIP_OPTS} mosquitto_ctrl "${DESTDIR}${prefix}/bin/mosquitto_ctrl" +endif +endif uninstall : -rm -f "${DESTDIR}${prefix}/bin/mosquitto_ctrl" diff --git a/apps/mosquitto_passwd/mosquitto_passwd.c b/apps/mosquitto_passwd/mosquitto_passwd.c index 92613f0f..9495c3c5 100644 --- a/apps/mosquitto_passwd/mosquitto_passwd.c +++ b/apps/mosquitto_passwd/mosquitto_passwd.c @@ -505,7 +505,7 @@ int main(int argc, char *argv[]) }else if(batch_mode == true && idx+3 == argc){ password_file_tmp = argv[idx]; username = argv[idx+1]; - password_cmd = argv[idx+1]; + password_cmd = argv[idx+2]; }else if(batch_mode == false && idx+2 == argc){ password_file_tmp = argv[idx]; username = argv[idx+1]; diff --git a/client/sub_client.c b/client/sub_client.c index 23cdd773..02f98ad4 100644 --- a/client/sub_client.c +++ b/client/sub_client.c @@ -45,13 +45,18 @@ struct mosquitto *mosq = NULL; int last_mid = 0; static bool timed_out = false; static int connack_result = 0; +bool connack_received = false; #ifndef WIN32 void my_signal_handler(int signum) { if(signum == SIGALRM || signum == SIGTERM || signum == SIGINT){ - process_messages = false; - mosquitto_disconnect_v5(mosq, MQTT_RC_DISCONNECT_WITH_WILL_MSG, cfg.disconnect_props); + if(connack_received){ + process_messages = false; + mosquitto_disconnect_v5(mosq, MQTT_RC_DISCONNECT_WITH_WILL_MSG, cfg.disconnect_props); + }else{ + exit(-1); + } } if(signum == SIGALRM){ timed_out = true; @@ -123,6 +128,8 @@ void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flag UNUSED(flags); UNUSED(properties); + connack_received = true; + connack_result = result; if(!result){ mosquitto_subscribe_multiple(mosq, NULL, cfg.topic_count, cfg.topics, cfg.qos, cfg.sub_opts, cfg.subscribe_props); diff --git a/config.mk b/config.mk index d64e2d00..de328ea3 100644 --- a/config.mk +++ b/config.mk @@ -125,7 +125,7 @@ WITH_XTREPORT=no # Also bump lib/mosquitto.h, CMakeLists.txt, # installer/mosquitto.nsi, installer/mosquitto64.nsi -VERSION=2.0.2 +VERSION=2.0.3 # Client library SO version. Bump if incompatible API/ABI changes are made. SOVERSION=1 diff --git a/docker/generic/Dockerfile b/docker/generic/Dockerfile index cc467946..bdda597b 100644 --- a/docker/generic/Dockerfile +++ b/docker/generic/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:latest AS build +FROM alpine:edge AS build # A released dist version, like "1.2.3" ARG VERSION @@ -6,14 +6,15 @@ RUN test -n "${VERSION}" RUN apk --no-cache add \ build-base \ - openssl-dev \ c-ares-dev \ + ca-certificates \ + cjson-dev \ curl \ - util-linux-dev \ libwebsockets-dev \ libxslt \ + openssl-dev \ python2 \ - ca-certificates + util-linux-dev # This build procedure is based on: # https://github.com/alpinelinux/aports/blob/master/main/mosquitto/APKBUILD @@ -48,6 +49,7 @@ LABEL maintainer="Jonathan Hanson " \ RUN apk --no-cache add \ busybox \ ca-certificates \ + cjson \ openssl \ libuuid \ libwebsockets \ diff --git a/include/mosquitto.h b/include/mosquitto.h index abbc8c2d..ef667693 100644 --- a/include/mosquitto.h +++ b/include/mosquitto.h @@ -59,7 +59,7 @@ extern "C" { #define LIBMOSQUITTO_MAJOR 2 #define LIBMOSQUITTO_MINOR 0 -#define LIBMOSQUITTO_REVISION 2 +#define LIBMOSQUITTO_REVISION 3 /* LIBMOSQUITTO_VERSION_NUMBER looks like 1002001 for e.g. version 1.2.1. */ #define LIBMOSQUITTO_VERSION_NUMBER (LIBMOSQUITTO_MAJOR*1000000+LIBMOSQUITTO_MINOR*1000+LIBMOSQUITTO_REVISION) diff --git a/installer/mosquitto.nsi b/installer/mosquitto.nsi index 1fa75ffb..702a0a98 100644 --- a/installer/mosquitto.nsi +++ b/installer/mosquitto.nsi @@ -9,7 +9,7 @@ !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' Name "Eclipse Mosquitto" -!define VERSION 2.0.2 +!define VERSION 2.0.3 OutFile "mosquitto-${VERSION}-install-windows-x86.exe" InstallDir "$PROGRAMFILES\mosquitto" diff --git a/installer/mosquitto64.nsi b/installer/mosquitto64.nsi index 274dd7d6..b40ef29e 100644 --- a/installer/mosquitto64.nsi +++ b/installer/mosquitto64.nsi @@ -9,7 +9,7 @@ !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' Name "Eclipse Mosquitto" -!define VERSION 2.0.2 +!define VERSION 2.0.3 OutFile "mosquitto-${VERSION}-install-windows-x64.exe" !include "x64.nsh" diff --git a/man/mosquitto.conf.5.xml b/man/mosquitto.conf.5.xml index 3af551c5..38affc75 100644 --- a/man/mosquitto.conf.5.xml +++ b/man/mosquitto.conf.5.xml @@ -869,7 +869,7 @@ log_timestamp_format %Y-%m-%dT%H:%M:%S If mosquitto is being automatically started by an init script it will usually be required to write a pid file. This should then be configured as e.g. - /var/run/mosquitto.pid + /var/run/mosquitto/mosquitto.pid Not reloaded on reload signal. diff --git a/mosquitto.conf b/mosquitto.conf index 216b8c7d..ef390cb5 100644 --- a/mosquitto.conf +++ b/mosquitto.conf @@ -145,7 +145,7 @@ # Write process id to a file. Default is a blank string which means # a pid file shouldn't be written. -# This should be set to /var/run/mosquitto.pid if mosquitto is +# This should be set to /var/run/mosquitto/mosquitto.pid if mosquitto is # being run automatically on boot with an init script and # start-stop-daemon or similar. #pid_file diff --git a/plugins/dynamic-security/Makefile b/plugins/dynamic-security/Makefile index 203fbc3e..810a17ba 100644 --- a/plugins/dynamic-security/Makefile +++ b/plugins/dynamic-security/Makefile @@ -74,9 +74,13 @@ clean: check: test test: -install: ${PLUGIN_NAME}.so +install: all +ifeq ($(WITH_CJSON),yes) +ifeq ($(WITH_TLS),yes) $(INSTALL) -d "${DESTDIR}$(prefix)/lib" $(INSTALL) ${STRIP_OPTS} ${PLUGIN_NAME}.so "${DESTDIR}${prefix}/lib/${PLUGIN_NAME}.so" +endif +endif uninstall : -rm -f "${DESTDIR}${prefix}/lib/${PLUGIN_NAME}.so" diff --git a/service/systemd/mosquitto.service.notify b/service/systemd/mosquitto.service.notify index 84b08f84..f4a15bbf 100644 --- a/service/systemd/mosquitto.service.notify +++ b/service/systemd/mosquitto.service.notify @@ -12,6 +12,8 @@ ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto ExecStartPre=/bin/chown mosquitto: /var/log/mosquitto +ExecStartPre=/bin/mkdir -m 740 -p /var/run/mosquitto +ExecStartPre=/bin/chown mosquitto: /var/run/mosquitto [Install] WantedBy=multi-user.target diff --git a/service/systemd/mosquitto.service.simple b/service/systemd/mosquitto.service.simple index d0e657e6..ebdbeed2 100644 --- a/service/systemd/mosquitto.service.simple +++ b/service/systemd/mosquitto.service.simple @@ -10,6 +10,8 @@ ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto ExecStartPre=/bin/chown mosquitto: /var/log/mosquitto +ExecStartPre=/bin/mkdir -m 740 -p /var/run/mosquitto +ExecStartPre=/bin/chown mosquitto: /var/run/mosquitto [Install] WantedBy=multi-user.target diff --git a/set-version.sh b/set-version.sh index e01b89df..11de2bda 100755 --- a/set-version.sh +++ b/set-version.sh @@ -2,7 +2,7 @@ MAJOR=2 MINOR=0 -REVISION=2 +REVISION=3 sed -i "s/^VERSION=.*/VERSION=${MAJOR}.${MINOR}.${REVISION}/" config.mk diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index c0155181..3e7257bc 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: mosquitto -version: 2.0.2 +version: 2.0.3 summary: Eclipse Mosquitto MQTT broker description: This is a message broker that supports version 5.0, 3.1.1, and 3.1 of the MQTT protocol. diff --git a/src/bridge.c b/src/bridge.c index e7e11202..6379c1a4 100644 --- a/src/bridge.c +++ b/src/bridge.c @@ -577,6 +577,7 @@ int bridge__register_local_connections(void) log__printf(NULL, MOSQ_LOG_ERR, "Error in epoll initial registering bridge: %s", strerror(errno)); return MOSQ_ERR_UNKNOWN; } + mux__add_out(context); } } #endif @@ -776,6 +777,8 @@ void bridge_check(void) mux__add_out(context); } }else if(rc == MOSQ_ERR_CONN_PENDING){ + mux__add_in(context); + mux__add_out(context); context->bridge->restart_t = 0; }else{ context->bridge->cur_address++; diff --git a/src/conf.c b/src/conf.c index d6918d30..4eb70432 100644 --- a/src/conf.c +++ b/src/conf.c @@ -664,7 +664,11 @@ int config__read(struct mosquitto__config *config, bool reload) len = strlen(config->persistence_location) + strlen(config->persistence_file) + 1; config->persistence_filepath = mosquitto__malloc(len); if(!config->persistence_filepath) return MOSQ_ERR_NOMEM; - snprintf(config->persistence_filepath, len, "%s%s", config->persistence_location, config->persistence_file); +#ifdef WIN32 + snprintf(config->persistence_filepath, len, "%s\\%s", config->persistence_location, config->persistence_file); +#else + snprintf(config->persistence_filepath, len, "%s/%s", config->persistence_location, config->persistence_file); +#endif }else{ config->persistence_filepath = mosquitto__strdup(config->persistence_file); if(!config->persistence_filepath) return MOSQ_ERR_NOMEM; diff --git a/src/database.c b/src/database.c index 120e3a5d..eec4f157 100644 --- a/src/database.c +++ b/src/database.c @@ -50,6 +50,9 @@ bool db__ready_for_flight(struct mosquitto_msg_data *msgs, int qos) * There is no queueing option, unless the client is offline and * queue_qos0_messages is enabled. */ + if(db.config->max_queued_messages == 0 && db.config->max_inflight_bytes == 0){ + return true; + } valid_bytes = msgs->msg_bytes - db.config->max_inflight_bytes < db.config->max_queued_bytes; valid_count = msgs->msg_count - msgs->inflight_maximum < db.config->max_queued_messages; diff --git a/src/handle_connect.c b/src/handle_connect.c index 7be9833a..5a33fdde 100644 --- a/src/handle_connect.c +++ b/src/handle_connect.c @@ -165,6 +165,14 @@ int connect__on_authorised(struct mosquitto *context, void *auth_data_out, uint1 if(context->clean_start == true){ sub__clean_session(found_context); } + if((found_context->protocol == mosq_p_mqtt5 && found_context->session_expiry_interval == 0) + || (found_context->protocol != mosq_p_mqtt5 && found_context->clean_start == true) + || (context->clean_start == true) + ){ + + context__send_will(found_context); + } + session_expiry__remove(found_context); will_delay__remove(found_context); will__clear(found_context); diff --git a/src/mux_poll.c b/src/mux_poll.c index 7f256916..79926641 100644 --- a/src/mux_poll.c +++ b/src/mux_poll.c @@ -59,15 +59,15 @@ Contributors: static void loop_handle_reads_writes(struct pollfd *pollfds); static struct pollfd *pollfds = NULL; -static size_t pollfd_max; +static size_t pollfd_max, pollfd_current_max; #ifndef WIN32 static sigset_t my_sigblock; #endif int mux_poll__init(struct mosquitto__listener_sock *listensock, int listensock_count) { - int i; - int pollfd_index = 0; + size_t i; + size_t pollfd_index = 0; #ifndef WIN32 sigemptyset(&my_sigblock); @@ -101,6 +101,7 @@ int mux_poll__init(struct mosquitto__listener_sock *listensock, int listensock_c pollfd_index++; } + pollfd_current_max = pollfd_index-1; return MOSQ_ERR_SUCCESS; } @@ -120,6 +121,9 @@ int mux_poll__add_out(struct mosquitto *context) pollfds[i].events = POLLIN | POLLOUT; pollfds[i].revents = 0; context->pollfd_index = i; + if(i > pollfd_current_max){ + pollfd_current_max = (size_t )i; + } break; } } @@ -150,6 +154,9 @@ int mux_poll__add_in(struct mosquitto *context) pollfds[i].events = POLLIN; pollfds[i].revents = 0; context->pollfd_index = i; + if(i > pollfd_current_max){ + pollfd_current_max = (size_t )i; + } break; } } @@ -160,11 +167,24 @@ int mux_poll__add_in(struct mosquitto *context) int mux_poll__delete(struct mosquitto *context) { + size_t pollfd_index; + if(context->pollfd_index != -1){ pollfds[context->pollfd_index].fd = INVALID_SOCKET; pollfds[context->pollfd_index].events = 0; pollfds[context->pollfd_index].revents = 0; + pollfd_index = (size_t )context->pollfd_index; context->pollfd_index = -1; + + /* If this is the highest index, reduce the current max until we find + * the next highest in use index. */ + while(pollfd_index == pollfd_current_max + && pollfd_index > 0 + && pollfds[pollfd_index].fd == INVALID_SOCKET){ + + pollfd_index--; + pollfd_current_max--; + } } return MOSQ_ERR_SUCCESS; @@ -184,10 +204,10 @@ int mux_poll__handle(struct mosquitto__listener_sock *listensock, int listensock #ifndef WIN32 sigprocmask(SIG_SETMASK, &my_sigblock, &origsig); - fdcount = poll(pollfds, pollfd_max, 100); + fdcount = poll(pollfds, pollfd_current_max+1, 100); sigprocmask(SIG_SETMASK, &origsig, NULL); #else - fdcount = WSAPoll(pollfds, pollfd_max, 100); + fdcount = WSAPoll(pollfds, pollfd_current_max+1, 100); #endif db.now_s = mosquitto_time(); diff --git a/src/security_default.c b/src/security_default.c index cc7e1f1b..d732e774 100644 --- a/src/security_default.c +++ b/src/security_default.c @@ -1112,6 +1112,10 @@ int mosquitto_security_apply_default(void) #endif HASH_ITER(hh_id, db.contexts_by_id, context, ctxt_tmp){ + if(context->bridge){ + continue; + } + /* Check for anonymous clients when allow_anonymous is false */ if(db.config->per_listener_settings){ if(context->listener){ diff --git a/test/broker/07-will-takeover.py b/test/broker/07-will-takeover.py index 8e04b423..1024a46a 100755 --- a/test/broker/07-will-takeover.py +++ b/test/broker/07-will-takeover.py @@ -5,7 +5,7 @@ from mosq_test_helper import * -def do_test(proto_ver, clean_session): +def do_test(proto_ver, clean_session1, clean_session2): rc = 1 keepalive = 60 @@ -13,17 +13,34 @@ def do_test(proto_ver, clean_session): connect1_packet = mosq_test.gen_connect("will-helper", keepalive=keepalive, proto_ver=proto_ver) connack1_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) - connect2_packet = mosq_test.gen_connect("will-test", keepalive=keepalive, proto_ver=proto_ver, will_topic="will/test", will_payload=b"LWT", clean_session=clean_session) - connack2a_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) - if clean_session == False and proto_ver == 4: - connack2b_packet = mosq_test.gen_connack(rc=0, flags=1, proto_ver=proto_ver) + if proto_ver == 5: + if clean_session1 == False: + connect_props1 = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 60) + else: + connect_props1 = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 0) + + if clean_session2 == False: + connect_props2 = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 60) + else: + connect_props2 = mqtt5_props.gen_uint32_prop(mqtt5_props.PROP_SESSION_EXPIRY_INTERVAL, 0) else: - connack2b_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) + connect_props1 = b"" + connect_props2 = b"" + + connect2_packet = mosq_test.gen_connect("will-test", keepalive=keepalive, proto_ver=proto_ver, will_topic="will/test", will_payload=b"LWT", clean_session=clean_session1, properties=connect_props1) + connack2_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) + + connect3_packet = mosq_test.gen_connect("will-test", keepalive=keepalive, proto_ver=proto_ver, clean_session=clean_session2, properties=connect_props2) + if clean_session1 == False and clean_session2 == False: + connack3_packet = mosq_test.gen_connack(rc=0, flags=1, proto_ver=proto_ver) + else: + connack3_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver) subscribe_packet = mosq_test.gen_subscribe(mid, "will/test", 0, proto_ver=proto_ver) suback_packet = mosq_test.gen_suback(mid, 0, proto_ver=proto_ver) publish_packet = mosq_test.gen_publish(topic="will/test", qos=0, payload="Client ready", proto_ver=proto_ver) + publish_lwt_packet = mosq_test.gen_publish(topic="will/test", qos=0, payload="LWT", proto_ver=proto_ver) port = mosq_test.get_port() broker = mosq_test.start_broker(filename=os.path.basename(__file__), port=port) @@ -34,17 +51,21 @@ def do_test(proto_ver, clean_session): mosq_test.do_send_receive(sock1, subscribe_packet, suback_packet, "suback") # Connect client with will - sock2 = mosq_test.do_client_connect(connect2_packet, connack2a_packet, timeout=5, port=port) + sock2 = mosq_test.do_client_connect(connect2_packet, connack2_packet, timeout=5, port=port) # Send a "ready" message sock2.send(publish_packet) mosq_test.expect_packet(sock1, "publish 1", publish_packet) # Connect client with will again as a separate connection, this should - # take over from the previous one but not trigger a Will. - sock3 = mosq_test.do_client_connect(connect2_packet, connack2b_packet, timeout=5, port=port) + # take over from the previous one but only trigger a Will if we are taking + # over a clean session/session-expiry-interval==0 client + sock3 = mosq_test.do_client_connect(connect3_packet, connack3_packet, timeout=5, port=port) sock2.close() + if clean_session1 == True or clean_session2 == True: + mosq_test.expect_packet(sock1, "publish LWT", publish_lwt_packet) + # Send the "ready" message again sock3.send(publish_packet) mosq_test.expect_packet(sock1, "publish 2", publish_packet) @@ -63,11 +84,15 @@ def do_test(proto_ver, clean_session): (stdo, stde) = broker.communicate() if rc: print(stde.decode('utf-8')) - print("proto_ver=%d clean_session=%d" % (proto_ver, clean_session)) + print("proto_ver=%d clean_session1=%d clean_session2=%d" % (proto_ver, clean_session1, clean_session2)) exit(rc) -do_test(proto_ver=4, clean_session=True) -do_test(proto_ver=4, clean_session=False) -do_test(proto_ver=5, clean_session=True) -do_test(proto_ver=5, clean_session=False) +do_test(proto_ver=4, clean_session1=True, clean_session2=True) +do_test(proto_ver=4, clean_session1=False, clean_session2=True) +do_test(proto_ver=4, clean_session1=True, clean_session2=False) +do_test(proto_ver=4, clean_session1=False, clean_session2=False) +do_test(proto_ver=5, clean_session1=True, clean_session2=True) +do_test(proto_ver=5, clean_session1=False, clean_session2=True) +do_test(proto_ver=5, clean_session1=True, clean_session2=False) +do_test(proto_ver=5, clean_session1=False, clean_session2=False) diff --git a/www/pages/download.md b/www/pages/download.md index d015405f..7436afda 100644 --- a/www/pages/download.md +++ b/www/pages/download.md @@ -1,7 +1,7 @@ + +Version 2.0.3 of Mosquitto has been released. This is a bugfix release. + +# Security +- Running mosquitto_passwd with the following arguments only + `mosquitto_passwd -b password_file username password` would cause the + username to be used as the password. + +# Broker +- Fix excessive CPU use on non-Linux systems when the open file limit is set + high. Closes [#1947]. +- Fix LWT not being sent on client takeover when the existing session wasn't + being continued. Closes [#1946]. +- Fix bridges possibly not completing connections when WITH_ADNS is in use. + Closes [#1960]. +- Fix QoS 0 messages not being delivered if max_queued_messages was set to 0. + Closes [#1956]. +- Fix local bridges being disconnected on SIGHUP. Closes [#1942]. +- Fix slow initial bridge connections for WITH_ADNS=no. + +# Clients +- Fix mosquitto_sub being unable to terminate with Ctrl-C if a successful + connection is not made. Closes [#1957]. + +# Apps +- Fix `mosquitto_passwd -b` using username as password (not if `-c` is also + used). Closes [#1949]. + +# Build +- Fix `install` target when using WITH_CJSON=no. Closes [#1938]. +- Fix `generic` docker build. Closes [#1945]. + +[#1938]: https://github.com/eclipse/mosquitto/issues/1938 +[#1942]: https://github.com/eclipse/mosquitto/issues/1942 +[#1945]: https://github.com/eclipse/mosquitto/issues/1945 +[#1946]: https://github.com/eclipse/mosquitto/issues/1946 +[#1947]: https://github.com/eclipse/mosquitto/issues/1947 +[#1949]: https://github.com/eclipse/mosquitto/issues/1949 +[#1956]: https://github.com/eclipse/mosquitto/issues/1956 +[#1957]: https://github.com/eclipse/mosquitto/issues/1957 +[#1960]: https://github.com/eclipse/mosquitto/issues/1960