Move check whether context is a bridge in front of check whether a listener

exists for context. New test now passes.

Signed-off-by: Wolfgang Hottgenroth <wolfgang.hottgenroth@icloud.com>
pull/891/head
Wolfgang Hottgenroth 7 years ago committed by Roger A. Light
parent 50b0c0b1f1
commit 88456c655f

@ -311,6 +311,7 @@ int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *conte
struct mosquitto__security_options *security_opts = NULL;
if(!db || !context || !topic) return MOSQ_ERR_INVAL;
if(context->bridge) return MOSQ_ERR_SUCCESS;
if(db->config->per_listener_settings){
if(!context->listener) return MOSQ_ERR_ACL_DENIED;
@ -322,7 +323,6 @@ int mosquitto_acl_check_default(struct mosquitto_db *db, struct mosquitto *conte
return MOSQ_ERR_PLUGIN_DEFER;
}
if(context->bridge) return MOSQ_ERR_SUCCESS;
if(access == MOSQ_ACL_SUBSCRIBE) return MOSQ_ERR_SUCCESS; /* FIXME - implement ACL subscription strings. */
if(!context->acl_list && !security_opts->acl_patterns) return MOSQ_ERR_ACL_DENIED;

Loading…
Cancel
Save