Commit Graph

245 Commits

Author SHA1 Message Date
Roger A. Light
550c54701e Fix cmake build when cjson not available. 2020-12-02 15:50:33 +00:00
Roger A. Light
27967f8885 Prevent possible unitialised use. 2020-12-02 10:10:21 +00:00
Roger A. Light
3731535298 Add SPDX license identifiers. 2020-12-01 20:46:56 +00:00
Roger A. Light
730fc34539 Build fix for WITH_TLS=no. 2020-12-01 13:40:03 +00:00
Roger A. Light
29c771cdd4 Add lib and client support for OS CA certs
- Add `MOSQ_OPT_TLS_USE_OS_CERTS` option, to instruct the client to load and  trust OS provided CA certificates for use with TLS connections.
- All clients now load OS provided CA certificates if used with `-L
  mqtts://...`, or if port is set to 8883 and no other CA certificates are
  used. Closes #1824.
- Add the `--tls-use-os-certs` option to all clients.

Closes #1824. Thanks to Jens Reimann.
2020-12-01 11:51:13 +00:00
Roger A. Light
b169dc0b1e mosquitto_sub will quit with an error on Windows if %U is used.
Seconds since the Unix epoch is not a parameter that can be obtained
with strftime on Windows.

Closes #1908. Thanks to Danil intl.
2020-11-26 09:10:04 +00:00
Roger A. Light
584cf51ba7 Update to EPL-2.0 2020-11-25 17:34:21 +00:00
Roger A. Light
d142ff69a6 Fix Coverity Scan issues.
511427
1431133
1436823
1436837
1436838
1436929
2020-11-24 00:22:34 +00:00
Roger A. Light
d26534e22b Fix Coverity scan issues.
1302840
1353078
1431131
1431134
1431135
1436826
1436827
1436828
1436830
1436831
1436834
1436835
1436838
1436839
1436840
1436844
1436846
1436853
1436854
1436859
1436860
1436861
1436863
1436867
2020-11-23 22:05:12 +00:00
Dan White
a65242d74a mosquitto_pub: exit if broker actively refuses a connection
Fixes eclipse/mosquitto#1904

If the broker rejects the connection, as opposed to the broker being
down, then there is no hope to establish a connection.  This adds a
status flag so we can signal to the loop that we should just exit.

Signed-off-by: Dan White <dan.white@valpo.edu>
2020-11-18 15:42:35 +00:00
Dan White
61702d7acc mosquitto_pub: exit if server becomes unreachable and QOS > 0
Fixes eclipse/mosquitto#1899

In stdin line mode, mosquitto_pub will continue running and accepting
input even if/when/after publishing fails.  This condition is reached
when it first successfully establishes a connection and the server later
is unreachable.

Exiting with a non-zero exit code allows for much easier health
monitoring when used in a long-running pipe.

Signed-off-by: Dan White <dan.white@valpo.edu>
2020-11-18 15:42:21 +00:00
Roger A. Light
a0c39b193b Fix description of -e and -t arguments in mosquitto_rr.
Closes #1881. Thanks to Arnav Singh.
2020-11-07 23:11:55 +00:00
Roger A. Light
8e7e4a9d9a Clients: Give warning if keepalive too low. 2020-11-03 09:51:28 +00:00
Roger A. Light
fdff255916 New dynamic security plugin. 2020-10-27 00:54:55 +00:00
Roger A. Light
4f61f6c161 Fix conversion errors. 2020-10-17 01:23:08 +01:00
Roger A. Light
89733138bb CMake build fixes. 2020-10-13 16:07:35 +01:00
Roger Light
5b4e4f047b Fix mosquitto_sub JSON printing with empty payloads. 2020-10-12 21:53:43 +01:00
Roger Light
ff2636b3ae Build fix for Windows. 2020-09-30 09:47:24 +01:00
Roger A. Light
c90e49af1b Merge remote-tracking branch 'origin/fixes' into develop 2020-09-24 17:03:14 +01:00
Roger A. Light
e2123b2561 Add --version for all clients. 2020-09-10 15:49:08 +01:00
Roger A. Light
cd33670f6a Fix build with WITH_CJSON=no 2020-09-08 12:26:55 +01:00
Roger A. Light
bab8cc2a6b mosquitto_sub now supports extra format specifiers.
These are for field width and precision for some parameters.
2020-08-28 22:23:22 +01:00
Roger A. Light
a224a8f217 Don't busy loop with mosquitto_pub -l on a slow connection. 2020-08-13 14:32:47 +01:00
Roger A. Light
9929ce0a26 All clients exit with an error exit code on CONNACK failure.
Closes #1778. Thanks to jflambert.
2020-08-12 09:44:42 +01:00
Roger A. Light
1b060bb064 Guard against use-after-free.
Coverity Scan 1431131, 1431135, 1431141.
2020-08-06 13:36:24 +01:00
Roger A. Light
e272f8fbca mosquitto_pub: Close file on file too large.
This wasn't a problem because this error caused the program to
exit, so there was no real resource leak.

Coverity Scan 1430457.
2020-07-15 12:04:20 +01:00
Roger A. Light
f846711ea2 mosquitto_pub now sends 0 length files without an error when using -f. 2020-07-15 12:03:15 +01:00
Roger A. Light
cadcde52a4 Remove duplicate code.
Coverity Scan 1430458.
2020-07-15 12:00:29 +01:00
Roger A. Light
5b4b079105 mosquitto_pub: Print reason string on publish error, if it exists. 2020-07-10 17:10:23 +01:00
Abilio Marques
22ffefe7f6 remove cjson stranded reference when building WITH_CJSON=no
Signed-off-by: Abilio Marques <abiliojr@gmail.com>
2020-05-20 11:17:13 +01:00
Roger A. Light
24049b1a1e Fix mosquitto_sub %j or %J not working on Windows.
Closes #1674. Thanks to amigian74.
2020-05-06 22:24:58 +01:00
Roger A. Light
c766bdfeb0 Display time out message only on SIGALRM. 2020-05-06 22:23:06 +01:00
Roger A. Light
b726e2f1ec mosquitto_sub %j and %J timestamps are now in a ISO 8601 compatible format. 2020-05-06 22:21:21 +01:00
Roger A. Light
40bad1a999 Fix conversion warnings in client code
Issue #1653.
2020-04-16 23:26:14 +01:00
Roger A. Light
0da723c1ec Add --random-filter to mosquitto_sub. 2020-03-03 14:12:30 +00:00
Roger A. Light
d96543c0b8 Merge branch 'fixes' into develop 2020-03-03 12:54:57 +00:00
Roger A. Light
b0a065f790 Update changelog. Release page. Bump copyright. 2020-02-27 23:26:58 +00:00
Roger A. Light
f16d9e2bcf Add file missing from earlier commit. 2020-02-06 21:06:03 +00:00
Roger A. Light
17e20de9e7 Fix session-expiry-interval for v5 clients using -c.
Default behaviour for v5 clients using `-c` is now to use infinite length
sessions, as with v3 clients.

Closes #1546. Thanks to Kiran Pradeep.
2020-02-06 16:14:29 +00:00
Roger A. Light
019d4214b8 Fix session-expiry-interval for v5 clients using -c.
Default behaviour for v5 clients using `-c` is now to use infinite length
sessions, as with v3 clients.

Closes #1546. Thanks to Kiran Pradeep.
2020-02-06 16:12:56 +00:00
Roger A. Light
56d0b950ac Fix --remove-retained not obeying the -T option.
This means `--remove-retained -t bbc/# -T bbc/one/#` would remove all
retained messages in `bbc/#`, instead of leaving all of the topics in
`bbc/one/#`.

Closes #1585. Thanks to Simon Moser.
2020-02-05 15:19:55 +00:00
Roger A. Light
3671a6dfdb Add -x argument to all clients.
This allows the session-expiry-interval property to be easily set for
MQTT v5 clients.
2020-01-30 11:19:09 +00:00
Roger A. Light
4e1e0f955f Record of which client argument letters are in use. 2020-01-30 11:09:04 +00:00
Roger A. Light
6aa9b91fff Add testing target for compiling test client fixes. 2020-01-02 21:40:03 +00:00
Roger A. Light
d60e86d2a3 Add TCP_NODELAY support to lib and clients.
Closes #1526. Thanks to Felix Moessbauer.
2019-12-18 17:04:43 +00:00
Roger A. Light
c0443637e8 Merge branch 'master'
Conflicts:
	ChangeLog.txt
	config.mk
	src/context.c
	src/loop.c
	src/subs.c
	test/broker/01-connect-bad-packet.py
	test/broker/02-subpub-qos1-bad-pubcomp.py
	test/broker/02-subpub-qos1-bad-pubrec.py
	test/broker/02-subpub-qos2-bad-puback-1.py
	test/broker/02-subpub-qos2-bad-puback-2.py
	test/broker/02-subpub-qos2-bad-pubcomp.py
	test/broker/02-subpub-qos2.py
	test/broker/07-will-null-topic.py
2019-12-03 13:59:05 +00:00
Basavesh Shivakumar
9bebab46ca In sub_client.c, call mosquitto_destroy()
Fixes: #1513 and frees resources when someone terminates
via SIGTERM or SIGINT.

Signed-off-by: Basavesh Shivakumar <basavesh.shivakumar@gmail.com>
2019-11-27 17:33:11 -05:00
Roger A. Light
1e04b22833 Fix mosquitto_pub -l not sending the final line of stdin
This would happen if the final line did not end with a new line.

Closes #1473. Thanks to majekw.
2019-11-07 18:25:56 +00:00
Roger A. Light
6bde209799 Added CLIENT_STATIC_LDADD to makefile builds
This allow more libraries to be linked when compiling the clients with a
static libmosquitto, as required for e.g. openssl on some systems.

Closes #1371. Thanks to Fabrice Fontaine.
2019-11-06 15:04:54 +00:00
Roger A. Light
22eb193309 Merge branch 'stdin-fix-1' of git://github.com/majekw/mosquitto into majekw-stdin-fix-1 2019-11-06 13:24:38 +00:00