From 5e8199323b1ca966f031df9cf717b97b28528255 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 14 Feb 2019 17:46:01 +0000 Subject: [PATCH] Fix clients being disconnected when ACLs are in use. This only affects the case where a client connects using a username, and the anonymous ACL list is defined but specific user ACLs are not defined. Closes #1162. Thanks to quonb. --- ChangeLog.txt | 9 +++++++++ src/security_default.c | 3 --- test/broker/Makefile | 1 + test/broker/ptest.py | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index b2b16a41..38eb9efe 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,12 @@ +1.5.8 - 2019xxxx +================ + +Broker: +- Fix clients being disconnected when ACLs are in use. This only affects the + case where a client connects using a username, and the anonymous ACL list is + defined but specific user ACLs are not defined. Closes #1162. + + 1.5.7 - 20190213 ================ diff --git a/src/security_default.c b/src/security_default.c index 44089d9b..723926d7 100644 --- a/src/security_default.c +++ b/src/security_default.c @@ -642,9 +642,6 @@ int acl__find_acls(struct mosquitto_db *db, struct mosquitto *context) } acl_tail = acl_tail->next; } - if(context->username && context->acl_list == NULL){ - return MOSQ_ERR_INVAL; - } }else{ context->acl_list = NULL; } diff --git a/test/broker/Makefile b/test/broker/Makefile index 715b97c7..be3b95e4 100644 --- a/test/broker/Makefile +++ b/test/broker/Makefile @@ -121,6 +121,7 @@ endif endif 09 : + ./09-acl-access-variants.py ./09-acl-empty-file.py ./09-plugin-auth-unpwd-success.py ./09-plugin-auth-unpwd-fail.py diff --git a/test/broker/ptest.py b/test/broker/ptest.py index f21ae8ce..e2d1142a 100755 --- a/test/broker/ptest.py +++ b/test/broker/ptest.py @@ -93,6 +93,7 @@ tests = [ (2, './08-tls-psk-pub.py'), (3, './08-tls-psk-bridge.py'), + (1, './09-acl-access-variants.py'), (1, './09-acl-empty-file.py'), (1, './09-plugin-auth-unpwd-success.py'), (1, './09-plugin-auth-unpwd-fail.py'),