25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Fix acl issue from cleanup

This commit is contained in:
Christophe Romain 2015-10-07 15:12:15 +02:00
parent f938c2a5e2
commit 653105a44f

View File

@ -289,7 +289,7 @@ match_acl(none, _JID, _Host) ->
match_acl(ACL, IP, Host) when tuple_size(IP) == 4;
tuple_size(IP) == 8 ->
lists:any(
fun({ip, {Net, Mask}}) ->
fun(#acl{aclspec = {ip, {Net, Mask}}}) ->
is_ip_match(IP, Net, Mask);
(_) ->
false
@ -297,7 +297,7 @@ match_acl(ACL, IP, Host) when tuple_size(IP) == 4;
match_acl(ACL, JID, Host) ->
{User, Server, Resource} = jlib:jid_tolower(JID),
lists:any(
fun(Spec) ->
fun(#acl{aclspec = Spec}) ->
case Spec of
all -> true;
{user, {U, S}} -> U == User andalso S == Server;
@ -346,11 +346,7 @@ match_acl(ACL, JID, Host) ->
get_aclspecs(ACL, Host)).
get_aclspecs(ACL, Host) ->
lists:flatmap(
fun(#acl{aclspec = Specs}) ->
Specs
end, ets:lookup(acl, {ACL, Host}) ++
ets:lookup(acl, {ACL, global})).
ets:lookup(acl, {ACL, Host}) ++ ets:lookup(acl, {ACL, global}).
is_regexp_match(String, RegExp) ->
case ejabberd_regexp:run(String, RegExp) of