Skip to content

Commit

Permalink
Merge branch 'master'
Browse files Browse the repository at this point in the history
Conflicts:
	ChangeLog.txt
  • Loading branch information
ralight committed Oct 2, 2018
2 parents 0e76bed + 5898cc9 commit 1867f30
Show file tree
Hide file tree
Showing 422 changed files with 21,888 additions and 1,352 deletions.
23 changes: 16 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
*.o
*.so
*.exe
*.db
c/*.test
cpp/*.test
*.pyc
*.vglog

build/

client/mosquitto_pub
client/mosquitto_sub

dist/

examples/mysql_log/mosquitto_mysql_log
examples/temperature_conversion/mqtt_temperature_conversion

lib/cpp/libmosquittopp.so*
lib/cpp/libmosquittopp.a
lib/libmosquitto.so*
lib/libmosquitto.a

man/mosquitto.8
man/mosquitto-tls.7
man/mosquitto.conf.5
Expand All @@ -18,9 +30,11 @@ man/mosquitto_passwd.1
man/mosquitto_pub.1
man/mosquitto_sub.1
man/mqtt.7

src/db_dump/mosquitto_db_dump
src/mosquitto
src/mosquitto_passwd

test/broker/broker.pid
test/test_client
test/fake_user
Expand All @@ -31,15 +45,10 @@ test/msgsps_sub.dat
test/broker/c/auth_plugin.so
test/broker/c/*.test

lib/cpp/libmosquittopp.so*
lib/cpp/libmosquittopp.a
lib/libmosquitto.so*
lib/libmosquitto.a

test/ssl/*.csr

test/lib/c/*.test
test/lib/cpp/*.test

build/
dist/
www/cache/
__pycache__
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ project(mosquitto)
cmake_minimum_required(VERSION 2.8)
# Only for version 3 and up. cmake_policy(SET CMP0042 NEW)

set (VERSION 1.5.0)
set (VERSION 1.5.3)

add_definitions (-DCMAKE -DVERSION=\"${VERSION}\")

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ Foundation IP policy.

Please read the [Eclipse Foundation policy on accepting contributions via Git](http:https://wiki.eclipse.org/Development_Resources/Contributing_via_Git).

1. Sign the [Eclipse CLA](http:https://www.eclipse.org/legal/CLA.php)
1. Register for an Eclipse Foundation User ID. You can register [here](https://dev.eclipse.org/site_login/createaccount.php).
2. Log into the [Projects Portal](https://projects.eclipse.org/), and click on the '[Eclipse CLA](https://projects.eclipse.org/user/sign/cla)' link.
2. Go to your [account settings](https://dev.eclipse.org/site_login/myaccount.php#open_tab_accountsettings) and add your GitHub username to your account.
1. Sign the [Eclipse ECA](http:https://www.eclipse.org/legal/ECA.php)
1. Register for an Eclipse Foundation User ID. You can register [here](https://accounts.eclipse.org/user/register).
2. Log into the [Accounts Portal](https://accounts.eclipse.org/), and click on the '[Eclipse Contributor Agreement](https://accounts.eclipse.org/user/eca)' link.
2. Go to your [account settings](https://accounts.eclipse.org/user/edit) and add your GitHub username to your account.
3. Make sure that you _sign-off_ your Git commits in the following format:
``` Signed-off-by: John Smith <[email protected]> ``` This is usually at the bottom of the commit message. You can automate this by adding the '-s' flag when you make the commits. e.g. ```git commit -s -m "Adding a cool feature"```
4. Ensure that the email address that you make your commits with is the same one you used to sign up to the Eclipse Foundation website with.
Expand Down
93 changes: 93 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,99 @@ Client features:
session without requiring a message to be received.


1.5.3 - 20180925
================

Security:
- Fix CVE-2018-12543. If a message is sent to Mosquitto with a topic that
begins with $, but is not $SYS, then an assert that should be unreachable is
triggered and Mosquitto will exit.

Broker:
- Elevate log level to warning for situation when socket limit is hit.
- Remove requirement to use `user root` in snap package config files.
- Fix retained messages not sent by bridges on outgoing topics at the first
connection. Closes #701.
- Documentation fixes. Closes #520, #600.
- Fix duplicate clients being added to by_id hash before the old client was
removed. Closes #645.
- Fix Windows version not starting if include_dir did not contain any files.
Closes #566.

Build:
- Various fixes to ease building.


1.5.2 - 20180919
================

Broker:
- Fix build when using WITH_ADNS=yes.
- Fix incorrect call to setsockopt() for TCP_NODELAY. Closes #941.
- Fix excessive CPU usage when the number of sockets exceeds the system limit.
Closes #948.
- Fix for bridge connections when using WITH_ADNS=yes.
- Fix round_robin false behaviour. Closes #481.
- Fix segfault on HUP when bridges and security options are configured.
Closes #965.

Library:
- Fix situation where username and password is used with SOCKS5 proxy. Closes
#927.
- Fix SOCKS5 behaviour when passing IP addresses. Closes #927.

Build:
- Make it easier to build without bundled uthash.h using "WITH_BUNDLED_DEPS=no".
- Fix build with OPENSSL_NO_ENGINE. Closes #932.


1.5.1 - 20180816
================

Broker:
- Fix plugin cleanup function not being called on exit of the broker.
Closes #900.
- Print more OpenSSL errors when loading certificates/keys fail.
- Use AF_UNSPEC etc. instead of PF_UNSPEC to comply with POSIX. Closes #863.
- Remove use of AI_ADDRCONFIG, which means the broker can be used on systems
where only the loopback interface is defined. Closes #869, Closes #901.
- Fix IPv6 addresses not being able to be used as bridge addresses.
Closes #886.
- All clients now time out if they exceed their keepalive*1.5, rather than
just reach it. This was inconsistent in two places.
- Fix segfault on startup if bridge CA certificates could not be read.
Closes #851.
- Fix problem opening listeners on Pi caused by unsigned char being default.
Found via #849.
- ACL patterns that do not contain either %c or %u now produce a warning in
the log. Closes #209.
- Fix bridge publishing failing when per_listener_settings was true. Closes
#860.
- Fix `use_identity_as_username true` not working. Closes #833.
- Fix UNSUBACK messages not being logged. Closes #903.
- Fix possible endian issue when reading the `memory_limit` option.
- Fix building for libwebsockets < 1.6.
- Fix accessor functions for username and client id when used in plugin auth
check.

Library:
- Fix some places where return codes were incorrect, including to the
on_disconnect() callback. This has resulted in two new error codes,
MOSQ_ERR_KEEPALIVE and MOSQ_ERR_LOOKUP.
- Fix connection problems when mosquitto_loop_start() was called before
mosquitto_connect_async(). Closes #848.

Clients:
- When compiled using WITH_TLS=no, the default port was incorrectly being set
to -1. This has been fixed.
- Fix compiling on Mac OS X <10.12. Closes #813 and #240.

Build:
- Fixes for building on NetBSD. Closes #258.
- Fixes for building on FreeBSD.
- Add support for compiling with static libwebsockets library.


1.5 - 20180502
==============

Expand Down
13 changes: 8 additions & 5 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ <h3>Third Party Content</h3>
did not receive this Content directly from the Eclipse Foundation, the following is provided
for informational purposes only, and you should look to the Redistributor's license for
terms and conditions of use.</p>
<p><em>
<strong>None</strong> <br><br>
<br><br>
</em></p>


<h4>libwebsockets 2.4.2</h4>
<p>This project makes use of the libwebsockets library.</p>
<p>The use of libwebsockets is based on the terms and conditions of the
LGPL 2.1 with some specific exceptions.
<a href="https://github.com/warmcat/libwebsockets/blob/v2.4.2/LICENSE">https://github.com/warmcat/libwebsockets/blob/v2.4.2/LICENSE</a></p>
<p>When libwebsockets is distributed with the project, it is being used
subject to the Static Linking Exception (Section 2) of the License. As
a result, the content is not subject to the LGPL 2.1.</p>

</body></html>
2 changes: 1 addition & 1 deletion client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include_directories(${mosquitto_SOURCE_DIR}/lib
include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib
${STDBOOL_H_PATH} ${STDINT_H_PATH})
link_directories(${mosquitto_BINARY_DIR}/lib)

Expand Down
16 changes: 8 additions & 8 deletions client/client_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and the Eclipse Distribution License is available at
Roger Light - initial implementation and documentation.
*/

#define _POSIX_C_SOURCE 200809L
#include "config.h"

#include <errno.h>
#include <fcntl.h>
Expand Down Expand Up @@ -983,20 +983,20 @@ int client_connect(struct mosquitto *mosq, struct mosq_config *cfg)
int rc;
int port;

#ifdef WITH_TLS
if(cfg->port < 0){
#ifdef WITH_TLS
if(cfg->cafile || cfg->capath
#ifdef WITH_TLS_PSK
# ifdef WITH_TLS_PSK
|| cfg->psk
#endif
# endif
){
port = 8883;
}else{
}else
#endif
{
port = 1883;
}
}else
#endif
{
}else{
port = cfg->port;
}

Expand Down
11 changes: 9 additions & 2 deletions client/pub_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ and the Eclipse Distribution License is available at
Roger Light - initial implementation and documentation.
*/

/* For nanosleep */
#define _POSIX_C_SOURCE 200809L
#include "config.h"

#include <errno.h>
#include <fcntl.h>
Expand Down Expand Up @@ -336,6 +335,14 @@ int main(int argc, char *argv[])
password = cfg.password;
quiet = cfg.quiet;

#ifndef WITH_THREADING
if(cfg.pub_mode == MSGMODE_STDIN_LINE){
fprintf(stderr, "Error: '-l' mode not available, threading support has not been compiled in.\n");
free(buf);
return 1;
}
#endif

if(cfg.pub_mode == MSGMODE_STDIN_FILE){
if(load_stdin()){
fprintf(stderr, "Error loading input from stdin.\n");
Expand Down
2 changes: 1 addition & 1 deletion client/sub_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and the Eclipse Distribution License is available at
Roger Light - initial implementation and documentation.
*/

#define _POSIX_C_SOURCE 200809L
#include "config.h"

#include <assert.h>
#include <errno.h>
Expand Down
12 changes: 11 additions & 1 deletion client/sub_client_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and the Eclipse Distribution License is available at
Roger Light - initial implementation and documentation.
*/

#define _POSIX_C_SOURCE 200809L
#include "config.h"

#include <assert.h>
#include <errno.h>
Expand All @@ -30,6 +30,10 @@ and the Eclipse Distribution License is available at
#define snprintf sprintf_s
#endif

#ifdef __APPLE__
# include <sys/time.h>
#endif

#include <mosquitto.h>
#include "client_shared.h"

Expand All @@ -38,6 +42,8 @@ static int get_time(struct tm **ti, long *ns)
{
#ifdef WIN32
SYSTEMTIME st;
#elif defined(__APPLE__)
struct timeval tv;
#else
struct timespec ts;
#endif
Expand All @@ -48,6 +54,10 @@ static int get_time(struct tm **ti, long *ns)

GetLocalTime(&st);
*ns = st.wMilliseconds*1000000L;
#elif defined(__APPLE__)
gettimeofday(&tv, NULL);
s = tv.tv_sec;
*ns = tv.tv_usec*1000;
#else
if(clock_gettime(CLOCK_REALTIME, &ts) != 0){
fprintf(stderr, "Error obtaining system time.\n");
Expand Down
3 changes: 1 addition & 2 deletions compiling.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
The following packages can be used to add features to mosquitto. All of them
are optional.

<<<<<<< HEAD
* openssl (version 1.0.0 or greater if TLS-PSK support is needed)
* openssl
* c-ares (for DNS-SRV support, disabled by default)
* libuuid (from util-linux, can be disabled)
* tcp-wrappers (optional, package name libwrap0-dev)
Expand Down
30 changes: 16 additions & 14 deletions config.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
#ifndef CONFIG_H
/* ============================================================
* Control compile time options.
* ============================================================
*
* Compile time options have moved to config.mk.
*/
* Platform options
* ============================================================ */

#ifdef __APPLE__
# define __DARWIN_C_SOURCE
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__SYMBIAN32__) || defined(__QNX__)
# define _XOPEN_SOURCE 700
# define __BSD_VISIBLE 1
# define HAVE_NETINET_IN_H
#else
# define _XOPEN_SOURCE 700
# define _DEFAULT_SOURCE 1
# define _POSIX_C_SOURCE 200809L
#endif


/* ============================================================
Expand All @@ -19,19 +28,12 @@
# ifndef strcasecmp
# define strcasecmp strcmpi
# endif
#define strtok_r strtok_s
#define strerror_r(e, b, l) strerror_s(b, l, e)
# define strtok_r strtok_s
# define strerror_r(e, b, l) strerror_s(b, l, e)
#endif


#define uthash_malloc(sz) mosquitto__malloc(sz)
#define uthash_free(ptr,sz) mosquitto__free(ptr)

#ifdef __APPLE__
# define __DARWIN_C_SOURCE
#else
# define _DEFAULT_SOURCE 1
# define _POSIX_C_SOURCE 200809L
#endif

#endif
Loading

0 comments on commit 1867f30

Please sign in to comment.