Skip to content

Commit 89a791d

Browse files
lukebakkenmergify[bot]
authored andcommitted
Use case-insensitive lists:member
References: * [`RMQ-1585`](https://vmw-jira.broadcom.net/browse/RMQ-1585) * https://github.com/lukebakken/rmq-1585 (cherry picked from commit 9bcd432)
1 parent afec372 commit 89a791d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

deps/rabbitmq_auth_backend_ldap/src/rabbit_auth_backend_ldap.erl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,20 @@ search_groups(LDAP, Desc, GroupsBase, Scope, DN) ->
385385
end.
386386

387387
search_nested_group(LDAP, Desc, GroupsBase, Scope, CurrentDN, TargetDN, Path) ->
388-
case lists:member(CurrentDN, Path) of
388+
Pred0 = fun(S) ->
389+
string:equal(CurrentDN, S, true)
390+
end,
391+
case lists:any(Pred0, Path) of
389392
true ->
390393
?L("recursive cycle on DN ~ts while searching for group ~ts",
391394
[CurrentDN, TargetDN]),
392395
false;
393396
false ->
394397
GroupDNs = search_groups(LDAP, Desc, GroupsBase, Scope, CurrentDN),
395-
case lists:member(TargetDN, GroupDNs) of
398+
Pred1 = fun(S) ->
399+
string:equal(TargetDN, S, true)
400+
end,
401+
case lists:any(Pred1, GroupDNs) of
396402
true ->
397403
true;
398404
false ->

0 commit comments

Comments
 (0)