Use case-insensitive `lists:member`

References:
* [`RMQ-1585`](https://vmw-jira.broadcom.net/browse/RMQ-1585)
* https://github.com/lukebakken/rmq-1585
This commit is contained in:
Luke Bakken 2025-03-26 11:43:56 -07:00
parent 9439756d62
commit 9bcd4328d2
No known key found for this signature in database
GPG Key ID: D99DE30E43EAE440
1 changed files with 8 additions and 2 deletions

View File

@ -385,14 +385,20 @@ search_groups(LDAP, Desc, GroupsBase, Scope, DN) ->
end.
search_nested_group(LDAP, Desc, GroupsBase, Scope, CurrentDN, TargetDN, Path) ->
case lists:member(CurrentDN, Path) of
Pred0 = fun(S) ->
string:equal(CurrentDN, S, true)
end,
case lists:any(Pred0, Path) of
true ->
?L("recursive cycle on DN ~ts while searching for group ~ts",
[CurrentDN, TargetDN]),
false;
false ->
GroupDNs = search_groups(LDAP, Desc, GroupsBase, Scope, CurrentDN),
case lists:member(TargetDN, GroupDNs) of
Pred1 = fun(S) ->
string:equal(TargetDN, S, true)
end,
case lists:any(Pred1, GroupDNs) of
true ->
true;
false ->