Commit Graph

575 Commits

Author SHA1 Message Date
Roger A. Light
e90a32835b Merge branch 'fixes' into develop 2018-05-02 22:24:49 +01:00
Roger A. Light
1a913bddd9 Fix realpath() usage for nonexistant files. 2018-05-02 21:21:07 +01:00
Roger A. Light
377dc82d3f Fix parsing of configuration options that end with a space.
Closes #804.

Thanks to Nicola Lunghi.
2018-05-02 21:04:46 +01:00
Roger A. Light
6c7ecd7e97 Fix compiling without TLS. 2018-05-02 21:04:42 +01:00
Roger A. Light
51ec5601c2 Fix memory leak that could be caused by a malicious CONNECT packet.
Closes #533493 (on Eclipse bugtracker)

Thanks to Daniel Romero.
2018-05-02 21:04:39 +01:00
Roger A. Light
cec1af1386 Don't print uninteresting epoll warnings. 2018-05-02 17:33:33 +01:00
Roger A. Light
5b4a4cfc6a Fix compilation warnings around _BSD_SOURCE. 2018-05-02 09:39:36 +01:00
Roger A. Light
2d1667b120 Remove c99-isms due to problems with dependencies. 2018-05-02 09:32:37 +01:00
Roger A. Light
23230b7b18 Add per-listener acl handling. 2018-05-01 22:54:25 +01:00
Roger A. Light
62d99ecbc2 Build fixes. 2018-04-23 23:56:39 +01:00
Roger A. Light
caa9e46fda Fix bad merge. 2018-04-19 20:38:10 +01:00
Roger A. Light
57ee8b92bc Mac build fixes. 2018-04-16 11:48:42 +01:00
Roger A. Light
7bf16919f3 Validate config strings as UTF-8. 2018-04-13 14:53:10 +01:00
Eric Schneeberger
e4e6a67959 Increase maximum connections (Windows) from 512 to 2048 (Maximum)
Signed-off-by: Eric Schneeberger <eric.schneeberger@gtt.com>
2018-04-13 12:10:45 +01:00
Roger A. Light
7615ae24ce Handle CONNECT protocol errors.
Don't allow username when no username flag set.
Don't allow password when no password flag set.

Closes #730. Closes #731.

Thanks to Umberto Boscolo.
2018-04-12 22:53:49 +01:00
Roger A. Light
729a09310a Add UTF-8 tests, plus some validation fixes.
Closes #693.
2018-04-12 22:20:10 +01:00
Roger A. Light
6a2172f472 Windows fixes. 2018-04-12 11:09:02 +01:00
Roger A. Light
f4c9435f54 Use server methods in the broker. 2018-04-12 10:24:03 +01:00
hailinzeng
a6aa3bc5f9 remove dead code
Signed-off-by: hailinzeng <hailinzeng@gmail.com>
2018-04-11 23:44:33 +01:00
Roger A. Light
5ff8127f44 Fix will sending for duplicate clients.
When a client with an in-use client-id connects, if the old client has a
will, send the will message. Closes #26.

Thanks to Pierre F.
2018-04-11 23:17:17 +01:00
Roger A. Light
943b311344 Don't use deprecated openssl functions. 2018-04-11 22:10:48 +01:00
Roger A. Light
a5781c0b46 Missing #endif. 2018-04-11 21:13:18 +01:00
Roger A. Light
24d68b5af8 Remove support for openssl 1.0.0 and 1.0.1.
These are no longer supported by openssl.
2018-04-11 17:12:25 +01:00
Roger A. Light
f4d238be18 Bump copyright years. 2018-04-11 15:24:29 +01:00
Roger A. Light
d982c265cb Fix signed/unsigned comparison.
Closes #747, closes #753.
2018-04-09 22:59:15 +01:00
Tifaifai Maupiti
f2376551bc Fix: use websockets without OpenSSL / TLS.
Signed-off-by: Tifaifai Maupiti <tifaifai.maupiti@gmail.com>
2018-04-09 21:29:22 +01:00
Roger A. Light
40e6a75709 Use c99 as compiling standard.
Closes: #765.
2018-04-06 00:33:22 +01:00
Roger A. Light
c3314fd593 Add missing tests (Closes #748). 2018-04-05 23:57:03 +01:00
Roger A. Light
2a05602d84 Obtain canonical name for password file. 2018-03-27 07:33:48 +01:00
Roger A. Light
d09d7c47c5 Further Coverity Scan fixes. 2018-03-27 00:06:39 +01:00
Roger A. Light
dbdd113c86 Merge branch 'develop' of github.com:eclipse/mosquitto into develop 2018-03-26 22:57:32 +01:00
Roger A. Light
e273c2593e Fix uninitialised variable. 2018-03-26 22:50:41 +01:00
Roger A. Light
8a22b918c0 Fix Coverity Scan defects. 2018-03-26 22:47:46 +01:00
Roger A. Light
a979ed6535 Per listener plugins. 2018-03-26 15:23:00 +01:00
Roger A. Light
a3b859a995 Remove name confusion 2018-03-25 21:49:14 +01:00
Roger A. Light
600217649b Merge branch 'develop' of github.com:eclipse/mosquitto into develop 2018-03-23 10:36:57 +00:00
Roger A. Light
13753f7661 Fix building mosquitto_passwd on Windows. 2018-03-23 10:35:50 +00:00
Roger A. Light
26bc3206cd Per listener allow_zero_length_clientid. 2018-03-18 21:23:50 +00:00
Roger A. Light
7271893966 Per listener auto_id_prefix. 2018-03-18 21:08:39 +00:00
Roger A. Light
4e266ff28f Copy default parameters. 2018-03-15 22:03:17 +00:00
Roger A. Light
fd7b08c0eb Per listener psk_file. 2018-03-15 21:39:42 +00:00
Roger A. Light
b2e1592376 Per listener allow_anonymous. 2018-03-15 14:29:07 +00:00
Roger A. Light
7046691b7d Reload password files properly. 2018-03-15 14:29:02 +00:00
Roger A. Light
aa87f3c170 Per listener allow_anonymous. 2018-03-15 12:18:19 +00:00
Roger A. Light
a571104809 Check correct password list. 2018-03-15 11:08:19 +00:00
Roger A. Light
0fef6bdee8 Maximum connections on Windows increased to 2048.
Thanks to ericGTT.
2018-03-14 10:01:47 +00:00
Peter Korsgaard
01ead7e73e websockets.c: unbreak build without TLS
Commit 7943072b1f (Fix use_identity_as_username not working on websockets
clients) added code which unconditionally accesses mosq-ssl, breaking the
build when TLS support is disabled.

Fix it by guarding this logic inside #ifdef WITH_TLS.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2018-03-13 23:16:25 +00:00
Roger A. Light
57e852db05 Per listener password file. 2018-03-13 17:52:04 +00:00
Roger A. Light
bc13eab9d6 Add per_listener_settings, which isn't used yet. 2018-03-13 17:52:03 +00:00
Roger A. Light
4d3f5b2b39 Ensure pollfd_index is initialised. 2018-03-13 17:52:03 +00:00
Thomas Pedley
ba8734b749 Add LWT message logging.
Signed-off-by: Thomas Pedley <me@shallax.com>
2018-03-13 13:41:58 +00:00
Roger A. Light
9ea0d38002 [706] Serve http /dir/ as /dir/index.html.
Thanks to Jean-Claude Wippler.
2018-03-13 09:12:54 +00:00
Roger A. Light
4f838e5161 Windows fixes. 2018-02-28 15:53:24 +00:00
Roger A. Light
5b2bf3d1c1 Bump version number, update copyrights. 2018-02-28 11:15:20 +00:00
Roger A. Light
e6cbff0e94 Fix unauthorised clients being able to cause OOM on connect. 2018-02-24 22:09:19 +00:00
Roger A. Light
b76982db13 Fix reloading of config when fds are exhausted. 2018-02-24 21:44:38 +00:00
Roger A. Light
ec63d7bfc7 Add set_tcp_nodelay option to disable Nagle's algorithm.
Bug: https://github.com/eclipse/mosquitto/issues/433
2018-02-14 23:51:16 +00:00
Roger A. Light
81cb7ab547 Merge branch 'fixes' into develop 2018-02-13 14:16:47 +00:00
Roger A. Light
c001e778c1 [693] Fix handling of null bytes in received strings.
Thanks to Umberto Boscolo.

Bug: https://github.com/eclipse/mosquitto/issues/693
2018-02-13 12:19:34 +00:00
Roger A. Light
3066f89a24 packet__read_string() returns the string length. 2018-02-11 20:47:17 +00:00
Roger A. Light
ff55499725 Fix persistence reloading. 2018-01-13 21:11:07 +00:00
Roger A. Light
027c5d7f6e Don't remove invalid socket from epoll fd. 2018-01-13 21:10:24 +00:00
Roger A. Light
2283585e39 Remove build timestamp information for reproducible builds. 2018-01-12 13:41:09 +00:00
Pierre Fersing
59380cef2d Fix CONNACK not send over WebSocket for bad auth
When client over WebSockets fail to authenticate, the CONNACK packet was
not sent because the connection was closed too early. Closes #18.

Signed-off-by: Pierre Fersing <pierre.fersing@bleemeo.com>
2018-01-12 13:34:12 +00:00
Roger A. Light
b4c72e8fc0 Fix HUP disconnecting clients incorrectly.
Bug: https://github.com/eclipse/mosquitto/issues/657
2018-01-10 22:34:03 +00:00
Roger A. Light
9c6a5f3cf0 [656] Fix building on Windows.
Thanks to Arun Kirthi Cherian.

Bug: https://github.com/eclipse/mosquitto/issues/656
2018-01-06 22:42:40 +00:00
Tatsuzo Osawa
024fd400d4 Fix Unsubscribe with No Topic
Signed-off-by: Tatsuzo Osawa <tatsuzo.osawa@gmail.com>
2018-01-06 12:11:06 +00:00
Pierre Fersing
7775924bae [534]Fix upgrade_outgoing_qos for retained message 2018-01-03 18:50:34 +01:00
Pierre Fersing
7df5c40004 Fix $SYS counters when message is sent over WS
Signed-off-by: Pierre Fersing <pierre.fersing@bleemeo.com>
2018-01-02 16:51:56 +01:00
Roger A. Light
7f82cdc753 [652] Don't limit config file lines to 1024 chars.
Bug: https://github.com/eclipse/mosquitto/issues/652
2017-12-20 11:00:16 +00:00
Michael Heimpold
48dec391f7 Quote ${DESTDIR} usage in various Makefiles
This prevents failures during make install when whitespace
is part of DESTDIR pathname.

Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com>
2017-12-01 22:28:26 +00:00
Roger A. Light
d3239920d7 Validate UTF-8 client ids, usernames and topics. 2017-08-16 11:28:54 +01:00
Roger A. Light
0745bcdb91 Improve some struct ordering. 2017-08-12 00:25:59 +01:00
Roger A. Light
8795f063d4 Add ability to deny access to SUBSCRIBE messages.
This is as well as the current read/write accesses. Currently for auth
plugins only.
2017-08-11 22:15:37 +01:00
Roger A. Light
7096d57c3a Documentation fix. 2017-08-09 22:17:11 +01:00
Roger A. Light
36e86355d7 Improve documentation and formatting. 2017-08-09 21:59:12 +01:00
toast-uz
df9ad5f0bd Add Epoll. (#495)
Signed-off-by: Tatsuzo Osawa <tatsuzo.osawa@gmail.com>
2017-07-27 18:43:09 +01:00
Roger A. Light
7943072b1f Fix use_identity_as_username not working on websockets clients.
Thanks to achest.
2017-07-26 23:27:04 +01:00
Roger A. Light
53c71b2a77 Fix memory leak related to use_identity_as_username. 2017-07-26 23:25:49 +01:00
Roger A. Light
c26b852c53 Don't double free when using remote_clientid/username/password. 2017-07-19 22:04:56 +01:00
Roger A. Light
ac6997d7bc Fix merge error. 2017-07-19 14:49:49 +01:00
Roger A. Light
5a267368d7 Merge branch 'master' into develop 2017-07-19 00:15:42 +01:00
Roger A. Light
ba0122f9a9 Don't disable IPv6 support for websockets. 2017-07-18 22:12:51 +01:00
Roger A. Light
d8cc5bc4fe Merge branch 'fixes' of github.com:eclipse/mosquitto into fixes 2017-07-17 22:02:30 +01:00
Roger A. Light
0ba0bc434e Use constant time memcmp for password checks. 2017-07-16 23:20:58 +01:00
Fredrik Fornwall
366194cde4 Replace getdtablesize() with sysconf(_SC_OPEN_MAX)
From http://man7.org/linux/man-pages/man3/getdtablesize.3.html:

"It is not specified in POSIX.1; portable applications should employ
sysconf(_SC_OPEN_MAX) instead of this call."

Specifically this fixes a build failure on Android which does not
have getdtablesize().

Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
2017-07-16 23:16:30 +01:00
Roger A. Light
e74203de2c Merge branch 'master' into develop 2017-07-16 22:52:01 +01:00
Roger A. Light
2a50b2e9bd Fix regression from 1.4.13 where persistence data was not being saved. 2017-07-10 23:43:42 +01:00
Roger A. Light
8de5ed4464 Remove "error in poll" messages. 2017-06-27 22:32:10 +01:00
Roger A. Light
cd17ca45cd [462] Relax CVE-2017-7650 checks.
Checks for '/' are no longer made, this character is a much lower risk
and is widely used in usernames.

Bug: https://github.com/eclipse/mosquitto/issues/462
2017-06-27 15:10:43 +01:00
Roger A. Light
c3823c0a81 [462] Add auth_plugin_deny_special_chars option.
Auth plugins can be configured to disable the check for +# in
usernames/client ids with the auth_plugin_deny_special_chars option.

Thanks to wiebeytec.

Bug: https://github.com/eclipse/mosquitto/issues/462
2017-06-27 14:59:37 +01:00
Roger A. Light
5246a76f87 [477] Send will messages for connected clients when broker stops.
Thanks to mikeS7.

Bug: https://github.com/eclipse/mosquitto/issues/477
2017-06-27 14:33:02 +01:00
Roger A. Light
96db6d6644 Fix CONNECT check for reserved=0, as per MQTT v3.1.1 check MQTT-3.1.2-3. 2017-06-27 11:11:43 +01:00
Roger A. Light
6e7d02ba16 Fix for CVE-2017-9868 for Windows. 2017-06-26 14:53:33 +01:00
Pierre Fersing
408972ddc1 Fix two issues with Websocket (#472)
* Websocket were always marked as "want_write" (even if they only
  want to read, or worse want nothing).
* Websocket FD was read twice in some case (when socket recv queue was
  larger that size read by libwebsocket)

Signed-off-by: Pierre Fersing <pierre.fersing@bleemeo.com>
2017-06-23 22:30:57 +01:00
Roger A. Light
09cb1b61c8 [468] Set persistence file to only be readable by owner.
Not implemented on Windows.

Thanks to Moshe Zioni.

Bug: https://github.com/eclipse/mosquitto/issues/468
2017-06-23 14:50:39 +01:00
Roger A. Light
ab45f86d74 Prevent out of bounds array access. 2017-06-22 09:47:03 +01:00
Roger A. Light
c78678607d [427] Fix large retained messages over websockets.
Thanks to Brian Block.

Bug: https://github.com/eclipse/mosquitto/issues/427
2017-06-19 21:40:19 +01:00
Roger A. Light
bb61cd2dee Fix merge error. 2017-06-19 18:31:58 +01:00
Roger A. Light
8f59d5ad28 Remove unused vars and reset pollfd_index on disconnect. 2017-06-19 16:14:59 +01:00