diff --git a/ChangeLog.txt b/ChangeLog.txt index 9da3ca97..c52b8e0d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,8 @@ Broker: have its DISCONNECT message processed properly and so no Will will be sent. Closes #7. - $SYS/broker/clients/disconnected should never be negative. Closes #287. +- Give better error message if a client sends a password without a username. + Closes #1015. Library: - Fix memory leak that occurred if mosquitto_reconnect() was used when TLS diff --git a/src/handle_connect.c b/src/handle_connect.c index 87964456..fd60addf 100644 --- a/src/handle_connect.c +++ b/src/handle_connect.c @@ -395,6 +395,7 @@ int handle__connect(struct mosquitto_db *db, struct mosquitto *context) if(context->protocol == mosq_p_mqtt311){ if(password_flag){ /* username_flag == 0 && password_flag == 1 is forbidden */ + log__printf(NULL, MOSQ_LOG_ERR, "Protocol error from %s: password without username, closing connection.", client_id); rc = MOSQ_ERR_PROTOCOL; goto handle_connect_error; }