diff --git a/etc/acl.conf b/etc/acl.conf index 3cb3b8c52..2560bf80d 100644 --- a/etc/acl.conf +++ b/etc/acl.conf @@ -24,6 +24,3 @@ {deny, all, subscribe, ["$SYS/#", {eq, "#"}]}. -{allow, all}. - - diff --git a/src/emqttd_acl_internal.erl b/src/emqttd_acl_internal.erl index 1cd32c0f4..5305985c4 100644 --- a/src/emqttd_acl_internal.erl +++ b/src/emqttd_acl_internal.erl @@ -30,7 +30,7 @@ -define(ACL_RULE_TAB, mqtt_acl_rule). --record(state, {config, nomatch = allow}). +-record(state, {config}). %%-------------------------------------------------------------------- %% API @@ -86,11 +86,11 @@ filter(_PubSub, {_AllowDeny, _Who, _, _Topics}) -> State :: #state{}). check_acl(_Who, #state{config = undefined}) -> allow; -check_acl({Client, PubSub, Topic}, #state{nomatch = Default}) -> +check_acl({Client, PubSub, Topic}, #state{}) -> case match(Client, Topic, lookup(PubSub)) of {matched, allow} -> allow; {matched, deny} -> deny; - nomatch -> Default + nomatch -> ignore end. lookup(PubSub) ->