aboutsummaryrefslogtreecommitdiff
path: root/src/acl.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2020-06-22 10:24:10 +0200
committerPaweł Chmielowski <pchmielowski@process-one.net>2020-06-22 10:24:10 +0200
commit768460b518ca77fb6cf4a38291610a218acd44a4 (patch)
tree88439ff0ff4d6a79606b9cce6987c85b77b699c0 /src/acl.erl
parentmod_stun_disco: Fix wording of log message (diff)
Correctly handle user_regexp acl rules with not matching host
This should fix issue reported in issue 3304
Diffstat (limited to 'src/acl.erl')
-rw-r--r--src/acl.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/acl.erl b/src/acl.erl
index d13c05601..03531607b 100644
--- a/src/acl.erl
+++ b/src/acl.erl
@@ -107,8 +107,8 @@ match_acl(_Host, {shared_group, {G, H}}, #{usr := {U, S, _}}) ->
end;
match_acl(Host, {shared_group, G}, Map) ->
match_acl(Host, {shared_group, {G, Host}}, Map);
-match_acl(_Host, {user_regexp, {UR, S}}, #{usr := {U, S, _}}) ->
- match_regexp(U, UR);
+match_acl(_Host, {user_regexp, {UR, S1}}, #{usr := {U, S2, _}}) ->
+ S1 == S2 andalso match_regexp(U, UR);
match_acl(_Host, {user_regexp, UR}, #{usr := {U, S, _}}) ->
ejabberd_router:is_my_host(S) andalso match_regexp(U, UR);
match_acl(_Host, {server_regexp, SR}, #{usr := {_, S, _}}) ->
@@ -117,8 +117,8 @@ match_acl(_Host, {resource_regexp, RR}, #{usr := {_, _, R}}) ->
match_regexp(R, RR);
match_acl(_Host, {node_regexp, {UR, SR}}, #{usr := {U, S, _}}) ->
match_regexp(U, UR) andalso match_regexp(S, SR);
-match_acl(_Host, {user_glob, {UR, S}}, #{usr := {U, S, _}}) ->
- match_regexp(U, UR);
+match_acl(_Host, {user_glob, {UR, S1}}, #{usr := {U, S2, _}}) ->
+ S1 == S2 andalso match_regexp(U, UR);
match_acl(_Host, {user_glob, UR}, #{usr := {U, S, _}}) ->
ejabberd_router:is_my_host(S) andalso match_regexp(U, UR);
match_acl(_Host, {server_glob, SR}, #{usr := {_, S, _}}) ->