Skip to content

Commit bb7cd83

Browse files
Merge pull request #13629 from rabbitmq/lukebakken/rmq-1585
Use case-insensitive `lists:member`
2 parents 9439756 + 9bcd432 commit bb7cd83

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)