Commit Graph

806 Commits

Author SHA1 Message Date
Roger Light
07399c2f3c Fix mosquitto_pub -l quitting if broker unavailable.
This could occur when a message publication is attempted when the broker
is temporarily unavailable.

Closes #2187. Thanks to JsBergbau.
2021-05-08 23:07:02 +01:00
Roger Light
d5ecd9f5aa Update CVE information. 2021-04-10 08:28:41 +01:00
Roger Light
c418b57d0f Fix possible crash having just upgraded from 1.6.
Happens if `per_listener_settings true` is set, and a SIGHUP is sent to
the broker before a client has reconnected to the broker.

Closes #2167. Thanks to momoskitto.
2021-04-08 23:29:46 +01:00
Roger A. Light
ec54bce037 Fix mosquitto_sub pipe close detection.
If sending mosquitto_sub output to a pipe, mosquitto_sub will now detect
that the pipe has closed and disconnect.

Closes #2164. Thanks to Frantisek Fuka.
2021-04-06 23:01:48 +01:00
Roger A. Light
eead0d2943 Fix build on Solaris non-sparc.
Closes #2136. Thanks to chuckunix.
2021-04-03 11:15:13 +01:00
Roger A. Light
6a4a547892 Fix segfault on client sending malformed CONNACk.
CVE-xxxx-xxxx: If an authenticated client connected with MQTT v5 sent a
malformed CONNACK message to the broker a NULL pointer dereference occurred,
most likely resulting in a segfault. This will be updated with the CVE
number when it is assigned.
Affects versions 2.0.0 to 2.0.9 inclusive.

Closes #2163. Thanks to Bryan Pearson.
2021-04-03 11:14:27 +01:00
Roger Light
6ebbb4d654 Fix possible socket leak.
This would occur if a client was using `mosquitto_loop_start()`, then if
the connection failed due to the remote server being inaccessible they
called `mosquitto_loop_stop(, true)` and recreated the mosquitto object.

See: https://www.eclipse.org/forums/index.php?t=rview&goto=1839865#msg_1839865
2021-04-02 11:03:01 +01:00
Roger Light
117e59b7cf Fix CMake cross compile builds not finding opensslconf.h.
Closes #2160. Thanks to Ozaq.
2021-04-01 21:53:13 +01:00
Roger A. Light
7d214a445d Fix TLS-PSK mode not working with port 8883.
Closes #2152. Thanks to jetpax.
2021-03-26 11:06:57 +00:00
Abilio Marques
91f34e084f fix duplication of messages during connect
Signed-off-by: Abilio Marques <abiliojr@gmail.com>
2021-03-22 07:59:37 +01:00
Roger Light
2de8c15bc9 Minor build fixes. 2021-03-21 09:18:43 +00:00
Roger Light
a6bb8d3611 Don't over write new receive-maximum if a v5 client connects.
This is for when it takes over an old session.

Closes #2134. Thanks to Frantisek Fuka.
2021-03-14 22:12:10 +00:00
Roger Light
9faf89be8d Set receive-maximum to not exceed the -C message count.
This is for mosquitto_sub and mosquitto_rr, to avoid potentially lost
messages.

Closes #2134. Thanks to Frantisek Fuka.
2021-03-14 19:24:56 +00:00
Roger A. Light
f8838243fb Fix connections retrying very rapidly in some situations.
Thanks to Abilio Marques.
2021-03-11 21:04:51 +00:00
Roger A. Light
891be8c2fe Fix max_keepalive option not applying to keepalive=0.
Closes #2117. Thanks to David Nadlinger.
2021-03-11 19:58:47 +00:00
Roger A. Light
f4d088b6d0 Improve logging of pull request.
Improve handling of invalid combinations of listener address and bind
interface configurations. Closes #2081.
2021-03-11 15:09:38 +00:00
Roger A. Light
88d2c74ab2 Fix bridge backoff calculation. 2021-03-11 15:02:31 +00:00
Roger A. Light
b7a08d5c40 Fix TLS bridge/lib incorrectly connecting on invalid CA file.
Closes #2130. Thanks to becz.
2021-03-11 12:45:04 +00:00
Roger Light
ace2aa764e Fix cmake epoll detection. 2021-03-08 23:57:04 +00:00
Roger A. Light
e401def06d Fix QoS 0 messages not being delivered when max_queued_bytes was configured.
Closes #2123. Thanks to quackgizmo.
2021-03-08 23:23:45 +00:00
Roger A. Light
f89a3c3fc0 Fix messages to $ prefixed topics being rejected.
Closes #2111. Thanks to yellowgg2.
2021-03-06 00:57:37 +00:00
Roger Light
64f697d55d Fix tls_version behaviour not matching documentation.
It was setting the exact TLS version to use, not the minimium TLS
version to use.

Closes #2110. Thanks to Petter Jönsson.
2021-03-03 22:21:24 +00:00
Roger A. Light
cec9d36445 Bump version and web pages. 2021-02-25 17:23:24 +00:00
Roger A. Light
465ee546c4 Update comment. 2021-02-25 17:13:56 +00:00
Roger A. Light
2190e98b20 Fix memory tracking not being available on FreeBSD or macOS.
Closes #2096. Thanks to blusewang.
2021-02-25 17:04:15 +00:00
Roger A. Light
12ff9d5e14 Allow Docker images to run with anon, without a config file.
Provide a mechanism for Docker users to run a broker that doesn't use
authentication, without having to provide their own configuration file.

Closes #2040.
2021-02-25 13:51:27 +00:00
Roger A. Light
9b08faf0bd Fix mosquitto_{pub|sub}_topic_check() function returns.
The would not return MOSQ_ERR_INVAL on topic == NULL.
2021-02-09 14:09:53 +00:00
Roger A. Light
1b24f625ea Give compile time warning for libwebsockets
If it is compiled without external poll support.

Closes #2060. Thanks to Yannic Schröder.
2021-02-09 13:18:58 +00:00
Roger A. Light
7fe638786d Fix mosquitto_evt_tick struct members. 2021-02-06 23:54:11 +00:00
Roger A. Light
24920c9a08 Fix possible loss of data in mosquitto_pub -l when sending multiple long lines.
Closes #2078. Thanks to Ysincit.
2021-02-06 23:05:52 +00:00
Roger A. Light
c2a26250f6 Bump changelog, versions, and web pages. 2021-02-04 10:10:13 +00:00
Roger A. Light
4a738f154e Fix openssl engine not being able to load private key.
Closes #2066. Thanks to Boris Vanhoof.
2021-02-03 21:54:35 +00:00
Roger A. Light
7a3b69f2d7 Fix possible leak during connect.
Closes #2057. Thanks to Przemysław Zygmunt.
2021-02-03 17:27:50 +00:00
Roger A. Light
1e6be1f123 Fix some minor memory leaks on exit only. 2021-02-03 17:27:44 +00:00
Roger A. Light
6c2dca51c3 Clients: Fix config files truncating options after the first space.
Closes #2059. Thanks to Jason White.
2021-02-03 10:11:44 +00:00
Roger A. Light
217b416a2d Fix man page building to not absolutely require xsltproc when using CMake.
This now handles the case where we are building from the released tar, or
building from git if xsltproc is available, or building from git if xsltproc
is not available.
2021-02-02 16:33:49 +00:00
Roger A. Light
05292cdbef Fix exporting of executable symbols on BSD when building via makefile. 2021-02-02 16:14:05 +00:00
Roger A. Light
2749b8c5b8 Merge branch 'fixes' 2021-01-28 12:28:53 +00:00
Roger A. Light
6e3738dcf0 Fix bridges not always connecting on Windows.
Closes #2043. Thanks to ttsorensen.
2021-01-26 13:19:08 +00:00
Roger Light
ad9a78dfc3 Note in the man pages that SIGHUP reloads TLS certificates.
Closes #2037. Thanks to Greg Troxel.
2021-01-25 23:09:03 +00:00
Roger A. Light
a4389fc9ce Fix SPDX identifiers: EDL-1.0 -> BSD-3-Clause.
The two licenses are the same.
2021-01-20 11:46:18 +00:00
Roger A. Light
cf1098eff1 Send protocol error on topic alias not found.
The error topic-alias-invalid was being sent if an MQTT v5 client published
a message with empty topic and topic alias set, but the topic alias hadn't
already been configured on the broker. This has been fixed to send a
protocol error, as per section 3.3.4 of the specification.
2021-01-20 10:28:40 +00:00
Roger A. Light
3c58ac9308 Fix message_size_limit not applying to the Will payload.
Closes #2022. Thanks to Umberto Morelli.
2021-01-19 11:51:50 +00:00
Roger A. Light
4165224885 Fix reloading of listeners where multiple listeners have the same port.
This is only possible where they have different bind addresses.

Closes #2029. Thanks to Simon Aldrich.
2021-01-19 10:16:06 +00:00
Roger A. Light
c9a4ef402e Update changelog. 2021-01-19 10:15:11 +00:00
Roger A. Light
e2ebddfc54 Improve logging in obscure cases when a client disconnects.
Closes #2017. Thanks to Craig Leres.
2021-01-15 13:54:14 +00:00
Roger A. Light
9c4b9a0311 ctrl: Error if new passwords don't match.
Produce an error when requesting a new password if both
attempts do not match.

Closes #2011. Thanks to Willem Eradus.
2021-01-15 12:30:42 +00:00
Roger A. Light
26fbd0ec74 ctrl: Allow command line arguments to override config file options.
Closes #2010. Thanks to Willem Eradus.
2021-01-15 12:19:20 +00:00
Roger A. Light
300dc54dad Add notes that libsystemd-dev or similar is needed.
This is when building with systemd support on Linux.

Closes #2019. Thanks to Mark Symmes.
2021-01-15 09:58:19 +00:00
Roger A. Light
00083623f0 Fix websockets listeners with TLS not responding.
Closes #2020. Thanks to FozzTexx.
2021-01-15 09:53:45 +00:00
Roger A. Light
b8c6f26995 Fix message expiry interval property not being honoured for plugins.
This happened in `mosquitto_broker_publish` and
`mosquitto_broker_publish_copy` only.
2021-01-14 18:19:26 +00:00
Roger A. Light
4be32aefc6 Fix potential duplicate Will messages being sent.
This could have occurred when a will delay interval had been set.
2021-01-14 00:22:27 +00:00
Roger A. Light
695bbc33c8 Fix calculation of remaining length parameter for websockets clients.
Only affects those clients that send fragmented packets.

Closes #1974. Thanks to 贺亚东.
2021-01-12 10:22:04 +00:00
Roger A. Light
5927778ae5 Improve logging in dynsec addGroupClient command.
Closes #2008. Thanks to Willem Eradus.
2021-01-11 13:28:20 +00:00
Roger A. Light
ae3800ad66 Bump version number, add www post. 2021-01-11 10:37:19 +00:00
Roger A. Light
d9a34fbb3a Improve documentation around the _v5() and non-v5 functions.
For example `mosquitto_publish()` and `mosquitto_publish_v5().
2021-01-11 10:05:34 +00:00
Roger A. Light
370cec5edd Fixes for lots of minor build warnings highlighted by Visual Studio. 2021-01-09 21:06:08 +00:00
Roger A. Light
6728c05a2c install Makefile target should depend on all, not mosquitto
This ensures that man pages are always built, even if a user runs `make
install` without building first.

Closes #1989. Thanks to woodz-.
2021-01-08 17:06:30 +00:00
Roger Light
7e1a818c54 Fix invalid behaviour in dynsec plugin.
This occurred if a group or client was deleted before a role that was
attached to the group or client is deleted.

Closes #1998. Thanks to Willem Eradus.
2021-01-08 00:01:10 +00:00
Roger Light
5b3acfe3cc Fix mosquitto_ctrl dynsec getGroup not showing roles.
Closes #1997. Thanks to Willem Eradus.
2021-01-07 23:36:56 +00:00
Roger Light
886ee6cd0c Fix bind_interface option.
Closes #1999. Thanks to Joerg55.
2021-01-07 22:50:32 +00:00
Roger Light
28c28fe707 Fix incorrect description in mosquitto_ctrl man page.
Closes #1995. Thanks to fyta2000.
2021-01-07 11:48:55 +00:00
Roger A. Light
70db9c486e Disallow control characters in mosquitto_passwd usernames. 2021-01-06 22:44:58 +00:00
Roger A. Light
93c730f799 Fix potential intermittent initial bridge connections when using poll(). 2021-01-06 22:03:34 +00:00
Roger A. Light
8385769b86 Fix apparmor incorrectly denying access db tmp file.
This is /var/lib/mosquitto/mosquitto.db.new.

Closes #1978. Thanks to gnampf89.
2020-12-27 23:05:53 +00:00
Roger A. Light
b2da540c64 Fix large packets not being completely published to slow clients.
Also fix bridge connection not relinquishing POLLOUT after messages are
sent.

Closes #1977. Thanks to marchaesen.
Closes #1979. Thanks to GorazdKikelj.
2020-12-27 23:03:38 +00:00
Roger A. Light
9d3732a62d Fix auth_method not being provided to the extended auth plugin event.
Closes #1975. Thanks to Jinming Chen.
2020-12-23 17:19:51 +00:00
Roger A. Light
5a565da82b Bump version number. Update changelog and web pages. 2020-12-22 16:56:07 +00:00
Roger A. Light
97d9f471c3 Fix websockets connections blocking non-ws connections on Windows.
Closes #1934. Thanks to sectokia and jarapa9.
2020-12-22 16:48:57 +00:00
Roger A. Light
b8962cc040 Add more log messages for dynsec load/save error conditions. 2020-12-22 10:00:23 +00:00
Roger A. Light
c6a6165f3b Fix dynamic security configuration possibly not being reloaded on Windows only.
Closes #1962. Thanks to martgeier.
2020-12-20 23:02:19 +00:00
Roger A. Light
4a012aef06 Fix man pages not being built when using CMake.
Closes #1969. Thanks to phplpf.
2020-12-20 22:33:01 +00:00
Roger A. Light
2db9aecac4 Do not reset bind address option if passed NULL.
mosquitto_connect_bind_async() and mosquitto_connect_bind_v5() should not
reset the bind address option if called with bind_address == NULL.

Otherwise calling mosquitto_connect_async() will *force* the bind
address to be reset, even if previously set with
mosquitto_string_option().
2020-12-20 17:21:17 +00:00
Roger A. Light
e02b5a2775 Fix $SYS/broker/publish/messages/+ counters not being updated for QoS 1, 2
Closes #1968. Thanks to promahn.
2020-12-18 22:55:10 +00:00
Roger A. Light
d02bc03ed8 Bump version, changelog and webpage. 2020-12-17 15:19:36 +00:00
Roger A. Light
f930970008 Fix persistence_location not appending a '/'. 2020-12-17 15:19:33 +00:00
Roger A. Light
2d9d1beee4 Fix ChangeLog error. Closes #1941. 2020-12-17 14:12:53 +00:00
Roger A. Light
f10de9831a Fix slow initial bridge connections for WITH_ADNS=no. 2020-12-17 14:12:53 +00:00
Roger A. Light
1d92184b2f Fix local bridges being disconnected on SIGHUP.
Closes #1942. Thanks to charlemagnelasse.
2020-12-17 14:00:50 +00:00
Roger A. Light
00c68203b8 Fix QoS 0 messages not being delivered if max_queued_messages was set to 0.
Closes #1956. Thanks to nduhme.
2020-12-17 11:57:15 +00:00
Roger A. Light
d05a49a2cf Fix bridges possibly not completing connections when WITH_ADNS is in use.
Closes #1960. Thanks to twegener-embertec.
2020-12-17 11:31:38 +00:00
Roger A. Light
de141540fb Fix mosquitto_sub being unable to terminate with Ctrl-C.
This occured if a successful connection was not made.

Closes #1957. Thanks to Peoh.
2020-12-17 10:40:58 +00:00
Roger Light
113603168b Fix LWT not being sent on client takeover.
This was not happening for the case when the existing session wasn't
being continued.

Closes #1946. Thanks to Rory Piper.
2020-12-13 23:11:02 +00:00
Roger Light
74f3285cf8 Fix generic docker build.
Closes #1945. Thanks to Andreas Schildbach.
2020-12-13 21:11:42 +00:00
Roger Light
f63386bf4a Fix mosquitto_passwd -b using username as password.
Only applies if if `-c` is not also used.

Closes #1949. Thanks to J. Augusto de Oliveira.
2020-12-13 20:32:30 +00:00
Roger A. Light
abac67299f Fix excessive CPU use on non-Linux systems when the open file limit is set high.
Closes #1947. Thanks to Patrick TJ McPhee.
2020-12-12 22:10:42 +00:00
Roger A. Light
f7dc138157 Fix install target when using WITH_CJSON=no.
Closes #1938. Thanks to apple3306 and JulianCaruso.
2020-12-11 00:07:11 +00:00
Roger A. Light
ecf6f9079a Fix build regression for WITH_WEBSOCKETS=yes on non-Linux systems. 2020-12-10 23:33:46 +00:00
Roger A. Light
2307c9fa07 Update web pages. 2020-12-10 14:39:16 +00:00
Roger A. Light
36eb5ca0c9 Bump changelog date. 2020-12-10 14:31:47 +00:00
Roger A. Light
37ce51703f Fix websockets listeners not causing the main loop not to wake up.
Closes #1936. Thanks to sectokia.
2020-12-10 12:31:52 +00:00
Roger A. Light
66b680af34 Bump version number. 2020-12-09 22:30:06 +00:00
Roger A. Light
d8dcfd75fe lib: Fix DH group not being set for TLS connections.
This meant ciphers using DHE couldn't be used.

Closes #1925. Closes #1476. Thanks to Jonathan Sönnerup, Valerii
Demeshko, and sectokia.
2020-12-09 22:30:06 +00:00
Roger A. Light
b7f0161f52 Fix DH group not being set for TLS connections.
This meant ciphers using DHE couldn't be used.

Closes #1925. Closes #1476. Thanks to Jonathan Sönnerup, Valerii
Demeshko, and sectokia.
2020-12-09 15:40:45 +00:00
Roger A. Light
bdfa5e714a Fix mosquitto_passwd -U 2020-12-09 14:08:37 +00:00
Roger A. Light
9968e35981 Fix websockets connections on Windows blocking subsequent connections.
Closes #1934. Thanks to sectokia.
2020-12-09 11:39:53 +00:00
Roger A. Light
0d747673d3 Distribute cmake/ and snap/ directories in tar. 2020-12-06 23:12:04 +00:00
Roger A. Light
c25229c13a Fix build using WITH_TLS=no when the openssl headers aren't available. 2020-12-04 23:44:38 +00:00
Roger A. Light
791c63372b Fix cjson include paths. 2020-12-04 22:15:19 +00:00
Roger A. Light
74db0e977f Merge branch 'develop' 2020-12-02 22:44:26 +00:00