Commit graph

4837 commits

Author SHA1 Message Date
Roger A. Light
246cd96d34 cmake: Fix test for WITH_SYS_TREE=OFF 2026-04-16 21:35:46 +01:00
Roger A. Light
d382c07377 cmake: Fix build and tests for WITH_LIB_CPP=OFF 2026-04-16 21:35:46 +01:00
Roger A. Light
14b5f40620 Test: Increase timeout for high load situations. 2026-04-16 21:35:46 +01:00
Roger A. Light
e5896c99c1 Fix incorrect port in lib msg sequence test 2026-04-16 21:35:46 +01:00
Roger A. Light
fe4343dac7 Tests: Add feature guards
This allows test runners to set environment variables to let tests know which features are available. This is done by the cmake tests, but probably won't be extended to the make tests.
2026-04-16 21:35:46 +01:00
Roger A. Light
ada3184901 cmake: Save features in use to a property 2026-04-16 21:35:46 +01:00
Roger A. Light
ac7266f948 Fix test 2026-04-16 21:35:46 +01:00
Roger A. Light
bea20e746f Parallel ctest support 2026-04-16 21:35:46 +01:00
Roger A. Light
c9175f5439 Simplify test 2026-04-16 21:35:46 +01:00
Roger A. Light
997c80b080 test: Fix incorrect port requirement count 2026-04-16 21:35:46 +01:00
Roger A. Light
b78cc47552 cmake: Only run tests for compiled components 2026-04-16 21:35:46 +01:00
Roger A. Light
7a2f0f3066 Protocol error edge case test fixes and redundant check removal 2026-04-15 12:31:28 +01:00
Roger A. Light
b3b4d77ef3 cmake: Disable http-api tests if library not available. 2026-02-25 11:40:50 +00:00
Yann E. MORIN
a487cd4f8f libcommon: check for getrandom()
Not all C libraries are glibc, or impersonating it; for example, musl
does not pretend to be any version of glibc. Thus, building on musl
fails when openssl is disabled, because no random-providing function is
detected, although musl does provide getrandom().

uClibc-ng on the other hand, can impersonate glibc, but availability of
getrandom() is not guatranteed there: getrandom() can be compiled out of
uClinbc-ng, or uClibc-ng can be too old to have it.

Add a configure-time check that getrandom() is available, as a fallback
when TLS is not enabled (and thus openssl is not used), and when not on
Win32 (where getting random numbers is always possible, at least from a
build perspective).

However, building with the plain Makefiles should keep working, so
slightly rework the defines checks in the code to account for the fact
that HAVE_GETRANDOM may already be defined at configure time.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
2026-02-25 08:27:42 +00:00
Roger A. Light
d3ee5c5ca6 Test: Don't error on missing psutil 2026-02-24 15:22:47 +00:00
Roger A. Light
e57342e7ac lib: Fix unix socket use on Windows
Closes #3521. Thanks to lt-havoc
2026-02-24 14:58:34 +00:00
Roger A. Light
ae19460c13 cmake: Only include C++ support when required
Thanks to Yann Morin
2026-02-24 10:26:50 +00:00
Yann E. MORIN
8c3bc32689 broker: properly check for getaddrinfo_a()
getaddrinfo_a( is protected by _GNU_SOURCE.

This is properly accounted for in the source code, in lib/net_mosq.c,
but the check in the CmakeList is missing that define, which causes
the check to actually fail.

Add that define when checking; this fixes builds on various C libraries,
like uClibc-ng, musl, or newer/older glibc.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
2026-02-24 09:38:49 +00:00
Roger A. Light
68b939f997 Don't run persist sqlite tests if WITH_SQLITE=no 2026-02-24 00:42:39 +00:00
Jesús Fernández Manzano
c6669ef715 Fix makefile build with WITH_SQLITE disabled
When using WITH_SQLITE=no, the build system correctly avoids to compile
the plugin, but the install step fails because it tries to install it
even if it has not been compiled.

This commit fixes this behaviour by totally omitting the plugin if
WITH_SQLITE=no is specified, so no compilation and no installation is
performed

Signed-off-by: Jesús Fernández Manzano <jesus.fernandez@titanos.tv>
2026-02-24 00:35:15 +00:00
Roger A. Light
7809621098 mosquitto_ctrl: Remove debug printf 2026-02-24 00:20:44 +00:00
Matt Turner
6cdc2356eb Don't run ctrl_shell tests without gmock and editline
Signed-off-by: Matt Turner <mattst88@gmail.com>
2026-02-23 23:29:56 +00:00
Roger A. Light
f5dd5d8519 Fix unix sockets support on Windows
Closes #3511. Thanks to lt-havoc.
2026-02-23 23:16:43 +00:00
Roger A. Light
7a1905006a Fix incorrect maximum-packet-size restriction for incoming packets.
Closes #3515. Thanks to Julian Graf.
2026-02-23 18:45:34 +00:00
Roger A. Light
b21c9f2c9a Fix incorrect parsing of unix socket address in proxy v2 2026-02-18 09:05:44 +00:00
Roger A. Light
66486e4748 Improve sqlite docs
Including removing the errant references to acl files.

Closes #3508. Thanks to Ulrich Berkmueller.
2026-02-17 00:19:24 +00:00
Roger A. Light
d0152406e3 Fix will messages being incorrectly delayed.
This occured if a client set session-expiry-interval=0 when using
will-delay-interval>0.

Closes #3505. Thanks to Julian Graf.
2026-02-16 11:37:36 +00:00
Roger A. Light
3a0f46aa20 Fix outgoing maximum-packet-size limit check.
Closes #3503. Thanks to Julian Graf.
2026-02-15 23:00:32 +00:00
Roger A. Light
36be278391 Fix tests when building with WITH_WEBSOCKETS=no.
Closes #3502. Thanks to Matt Turner
2026-02-14 23:56:27 +00:00
Roger A. Light
22f30a92b1 cmake: Ensure all targets that need cJSON have it 2026-02-13 15:51:17 +00:00
Roger A. Light
ab294813f5 Fix bridge clean session tests
Closes #3493. Thanks to Matt Turner
2026-02-13 15:29:12 +00:00
Roger A. Light
1ff8c6e2ab Formatting fixes 2026-02-13 13:20:22 +00:00
Roger A. Light
0c16558320 cmake: Fix linker errors on AIX.
Thanks to Andreas Kempf.
2026-02-13 13:15:03 +00:00
Roger A. Light
01e175969e Fix libmosquitto_static cmake build. 2026-02-13 13:14:50 +00:00
Roger A. Light
d2435fc685 cmake: Simplify WITH_BUNDLED_DEPS handling 2026-02-13 13:14:50 +00:00
Roger A. Light
43c2715042 Fix password length not being passed to MOSQ_EVT_BASIC_AUTH events.
Closes #3490. Thanks to thehouseisonfire.
2026-02-13 13:14:38 +00:00
Jan Palus
33d14397c4 Fix build with USE_LIBWRAP
Signed-off-by: Jan Palus <jpalus@fastmail.com>
2026-02-13 12:21:12 +00:00
Roger A. Light
64ccdc712d Fix missing SONAME.
Closes #3483. Thanks to Matt Turner.
2026-02-13 11:21:28 +00:00
Roger A. Light
da7d02690b Fix mosquitto_loop_start() leaving the mosq struct in an invalid state
This occurs if thread creation fails.

Closes #3496. Thanks to ehoffman2.
2026-02-13 08:33:32 +00:00
Roger A. Light
7984e50f75 Don't run http-api tests without support
Closes #3494. Thanks to Matt Turner.
2026-02-13 00:56:07 +00:00
Roger A. Light
c5e7d6c21e Don't run ./13-websocket-bad-origin.py without websockets support
Closes #3495. Thanks to Matt Turner.
2026-02-13 00:55:45 +00:00
Roger A. Light
7958a85bae Fix potential crash if group id has no group name.
This can occur if reading a file in restricted mode and the group id
does not have an entry in /etc/groups.

Closes #3498. Thanks to Stefan Kranich.
2026-02-13 00:36:47 +00:00
Roger A. Light
189e370313 Fix missing unix sockets support on Windows 2026-02-11 23:45:25 +00:00
Roger A. Light
2d2950a6a5 Fix makefile build with WITH_EDITLINE=no.
Closes #3484. Thanks to Matt Turner.
2026-02-11 15:48:10 +00:00
Roger A. Light
800ec38e22 Fix payload conversion in migrate_to_persist_sqlite.py
Closes #3492. Thanks to Marc Haesen.
2026-02-11 14:53:02 +00:00
Roger A. Light
5f2a45d96a Fix MOSQ_EVT_DISCONNECT being called before MOSQ_EVT_ACL_CHECK
This occurs for the will of that client.

Closes #3487. Thanks to ChrisBFX.
2026-02-11 14:43:57 +00:00
Roger A. Light
5b74cce8a4 Docker update 2026-02-09 11:47:21 +00:00
Roger A. Light
99fa50f30e Release prep for 2.1.2 2026-02-09 09:29:02 +00:00
Roger A. Light
20d9578077 Fix cmake linking of libwebsockets static/shared 2026-02-09 09:24:43 +00:00
Roger A. Light
fbe9470657 kqueue: Fix EV_EOF support 2026-02-08 21:56:19 +00:00