Skip to content

Commit 9492340

Browse files
michaelklishinmergify-bot
authored andcommitted
LDAP: match on eldap_search_result record for OTP 24.3 compat
In erlang/otp#5538, the eldap_search_result record structure has changed: https://github.com/erlang/otp/pull/5538/files#diff-30e064e89b115da7e974f229ed5c92f28e489da679ef42f17e70b9e7cf874179R24 It does have a default but for code compiled on, say, Erlang 23.0, which is the case for current RabbitMQ releases, it would still be a breaking change resulting in case expression matching failures (a case_clause). Closes #4284. (cherry picked from commit 730856e) (cherry picked from commit bedb709)
1 parent 9f61f5f commit 9492340

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

deps/rabbitmq_auth_backend_ldap/src/rabbit_auth_backend_ldap.erl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,12 @@ dn_lookup(Username, LDAP) ->
829829
{attributes, ["distinguishedName"]}]) of
830830
{ok, {referral, Referrals}} ->
831831
{error, {referrals_not_supported, Referrals}};
832-
{ok, #eldap_search_result{entries = [#eldap_entry{object_name = DN}]}}->
832+
%% support #eldap_search_result before and after
833+
%% https://github.com/erlang/otp/pull/5538
834+
{ok, {eldap_search_result, [#eldap_entry{object_name = DN}], _Referrals}}->
835+
?L1("DN lookup: ~s -> ~s", [Username, DN]),
836+
DN;
837+
{ok, {eldap_search_result, [#eldap_entry{object_name = DN}], _Referrals, _Controls}}->
833838
?L1("DN lookup: ~s -> ~s", [Username, DN]),
834839
DN;
835840
{ok, #eldap_search_result{entries = Entries}} ->

0 commit comments

Comments
 (0)