Commit graph

59 commits

Author SHA1 Message Date
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
d2435fc685 cmake: Simplify WITH_BUNDLED_DEPS handling 2026-02-13 13:14:50 +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
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
0a64c1de23 OpenBSD build fixes
Closes #3474. Thanks to Stuart Henderson
2026-02-06 14:50:20 +00:00
Roger A. Light
5ce4f07f6a Fix build for WITH_TLS=no WITH_ARGON2=yes WITH_ASAN=yes 2026-02-05 10:43:39 +00:00
Roger A. Light
16f41e61fc Add MOSQUITTO_UNSAFE_ALLOW_SYMLINKS env var
Setting this environment variable allows sensitive files to be read
through symlinks.

Closes #3461. Thanks to Jeff Cutsinger
2026-02-02 16:33:37 +00:00
Roger A. Light
7de6cb42ef Compiler warning fixes 2026-01-23 08:44:34 +00:00
Roger A. Light
b2aa092267 libcommon base64 unit tests 2025-12-01 00:05:36 +00:00
Roger A. Light
27aa1e14cb Fix libcommon log printing 2025-10-29 23:06:33 +00:00
Roger A. Light
2e669a1c32 mosquitto_read_file: Set return values early 2025-10-29 10:45:04 +00:00
Roger A. Light
6274730810 libcommon: Use mosquitto_fopen in mosquitto_read_file 2025-10-29 10:44:03 +00:00
Roger A. Light
0ba2436589 Remove unused srand() etc. functions 2025-10-15 11:49:13 +01:00
Roger A. Light
4d296b2f78 Remove magic number 2025-10-13 23:17:22 +01:00
Roger A. Light
7ea73f6d60 Formatting: Forbid single line if statements
These hide cases from coverage checks
2025-09-17 12:48:02 +01:00
Roger A. Light
48b76e49f8 Formatting: Misc automatic formatting changes 2025-09-17 12:03:06 +01:00
Roger A. Light
883fdb2ad2 Formatting: Double indent continuation 2025-09-17 12:03:06 +01:00
Roger A. Light
6e7ddef145 Formatting: Always include comma for last enum
Plus some spacing
2025-09-17 12:03:06 +01:00
Roger A. Light
9d95bf24c3 Formatting: Indent fixes 2025-09-17 12:03:06 +01:00
Roger A. Light
d743413ac3 Formatting: Spacing consistency 2025-09-17 12:03:06 +01:00
Roger A. Light
67ad22df0a Formatting: Double space before functions. 2025-09-17 12:03:03 +01:00
Roger A. Light
4f943e91da Fix some install inconsistencies 2025-09-16 11:48:55 +01:00
Roger A. Light
bd40dda241 libcommon: Remove unused WITH_BROKER code 2025-08-23 08:52:24 +01:00
Roger A. Light
156e7be807 Fix Coverity Scan #1592959 2025-08-22 15:21:30 +01:00
Roger A. Light
8ba1017df4 Fix Coverity Scan #1619414
Leak of file handle on error
2025-08-22 13:00:21 +01:00
Roger A. Light
c64273f663 Fix build on Mac OS, introduce Mac OS CI workflow
Closes #3312
2025-08-14 08:38:45 +01:00
Roger A. Light
b1e78d3915 Fix coverity scan 159296, dereference after null check 2025-08-10 19:47:06 +01:00
Roger A. Light
14ce957168 Fix coverity scan 1619418, logically dead code 2025-08-10 19:42:54 +01:00
Roger A. Light
b8ffdb878e Merge from master 2025-07-25 19:13:51 +01:00
Roger A. Light
82256e14b0 Use mosquitto_read_file() in mosquitto_pub 2025-07-18 07:25:44 +01:00
Roger A. Light
e3b2d51002 mosquitto_read_file should return file length 2025-07-17 22:05:34 +01:00
Roger A. Light
8fc1c1e07f Various fixes
Dashboard include paths
Libcommon.so not being installed
snacraft packaging update
http-api able to use compile time definition
2025-07-11 00:39:56 +01:00
Roger A. Light
0c0683094b Allow plugins to choose when their tick event is next called 2025-07-10 21:06:01 +01:00
Roger A. Light
43dda2ae20 Fix some build variants 2025-07-10 16:08:49 +01:00
Roger A. Light
c0c03a9d18 Add basic http api listener
This can currently be used to serve stats and listener details over http/https
2025-07-10 00:53:03 +01:00
Roger A. Light
c522361d35 Move acl_file code to own file. 2025-07-10 00:39:51 +01:00
Roger A. Light
3511db6889 Whitespace tidy
Some checks failed
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Coverage / coverage (push) Has been cancelled
Mosquitto - CMake / build (push) Has been cancelled
Mosquitto - Make ASAN / build (push) Has been cancelled
Mosquitto - Make / build (push) Has been cancelled
Windows build / mosquitto (push) Has been cancelled
2025-04-06 22:40:48 +01:00
Roger A. Light
1662641b25 Revert high CPU password hashing until separate threads are used 2025-02-27 22:34:47 +00:00
Roger A. Light
dd2c25c1cf Merge branch 'master' into develop 2024-10-19 22:13:14 +01:00
Roger A. Light
2f32fcd949 Move properties_to_json to libmosquitto_common 2024-06-18 17:54:02 +01:00
Roger A. Light
7faad7ca78 Move password functions to libcommon. 2024-06-18 17:54:00 +01:00
Roger A. Light
b5e21d146d Move password functions to libcommon. 2024-06-12 21:26:25 +01:00
Roger A. Light
db6ab6869a Fix mismatched alloc/frees 2024-04-25 16:20:14 +01:00
Roger A. Light
48eddd5676 Check for mismatched mosquitto_malloc / free calls. 2024-04-25 14:59:46 +01:00
Roger A. Light
41a310a6f1 Fix line endings 2024-04-25 11:51:33 +01:00
Roger A. Light
b5f1ffde2a Refactor memory tracking to prevent underflow. 2024-04-25 11:47:16 +01:00
Roger Light
20b34150f2 Windows build fixes 2024-03-27 08:38:13 +00:00
Roger A. Light
79022d6b4d Make libmosquitto_common shared on Windows. 2024-03-27 08:38:13 +00:00
Roger A. Light
df7fe15f75 Test vcpkg based build 2024-03-27 08:38:13 +00:00
Roger A. Light
9065b579d0 Refactor topic functions to common static library. 2024-03-17 23:18:35 +00:00