Merge pull request #13629 from rabbitmq/lukebakken/rmq-1585

Use case-insensitive `lists:member`
This commit is contained in:
Michael Klishin 2025-03-26 22:20:49 -04:00 committed by GitHub
commit bb7cd8381e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 2 deletions

View File

@ -385,14 +385,20 @@ search_groups(LDAP, Desc, GroupsBase, Scope, DN) ->
end. end.
search_nested_group(LDAP, Desc, GroupsBase, Scope, CurrentDN, TargetDN, Path) -> 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 -> true ->
?L("recursive cycle on DN ~ts while searching for group ~ts", ?L("recursive cycle on DN ~ts while searching for group ~ts",
[CurrentDN, TargetDN]), [CurrentDN, TargetDN]),
false; false;
false -> false ->
GroupDNs = search_groups(LDAP, Desc, GroupsBase, Scope, CurrentDN), 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 ->
true; true;
false -> false ->