Skip to content

Commit

Permalink
Move check whether context is a bridge in front of check whether a li…
Browse files Browse the repository at this point in the history
…stener

exists for context. New test now passes.

Signed-off-by: Wolfgang Hottgenroth <[email protected]>
  • Loading branch information
wollud1969 authored and ralight committed Aug 8, 2018
1 parent 50b0c0b commit 88456c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/security_default.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit 88456c6

Please sign in to comment.