From 121c2ca002cb7a7a4a23fa46bfba14f7bd898123 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 6 May 2015 04:54:11 -0500 Subject: [PATCH] Broker will return CONNACK rc=5 when a client is not authorised. This was being incorrectly set as rc=4. --- ChangeLog.txt | 2 ++ src/read_handle_server.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index bddabfea..178e9db6 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -9,6 +9,8 @@ Broker: - ACLs are now checked before sending a will message. - Fix possible crash when using bridges on Windows. Closes #465384. - Fix parsing of auth_opt_ arguments with extra spaces/tabs. +- Broker will return CONNACK rc=5 when a username/password is not authorised. + This was being incorrectly set as rc=4. Client library: - Inflight message count wasn't being decreased for outgoing messages using diff --git a/src/read_handle_server.c b/src/read_handle_server.c index f349c762..7c370a4e 100644 --- a/src/read_handle_server.c +++ b/src/read_handle_server.c @@ -366,7 +366,7 @@ int mqtt3_handle_connect(struct mosquitto_db *db, struct mosquitto *context) case MOSQ_ERR_SUCCESS: break; case MOSQ_ERR_AUTH: - _mosquitto_send_connack(context, 0, CONNACK_REFUSED_BAD_USERNAME_PASSWORD); + _mosquitto_send_connack(context, 0, CONNACK_REFUSED_NOT_AUTHORIZED); mqtt3_context_disconnect(db, context); rc = 1; goto handle_connect_error;