[erlang-questions] eldap using binary() rather than string() in Erlang 17.0 rc2?

Hans Nilsson hans@REDACTED
Wed Mar 5 16:33:14 CET 2014


It's because of the non-backward compatible change in the asn.1 
representation which we forgot to compensate for in eldap.  We will 
correct this eldap behaviour back to strings.

Thanks for the report!

/Hans

2014-03-05 13:56, Simon MacMullen skrev:
> Using R16B01:
>
> 1> {ok, LDAP} = eldap:open(["localhost"], []).
> {ok,<0.34.0>}
> 2> eldap:search(LDAP, [{base, "cn=Simon 
> MacMullen,ou=People,dc=example,dc=com"},{filter, 
> eldap:present("objectClass")}, {attributes, ["description"]}]).
> {ok,{eldap_search_result,
>         [{eldap_entry,
>              "cn=Simon MacMullen,ou=people,dc=example,dc=com",
>              [{"description",["can-declare-queues"]}]}],
>         []}}
>
> So the attribute key/values come back as lists.
>
> Using 17.0 rc2:
>
> 1> {ok, LDAP} = eldap:open(["localhost"], []).
> {ok,<0.34.0>}
> 2> eldap:search(LDAP, [{base, "cn=Simon 
> MacMullen,ou=People,dc=example,dc=com"},{filter, 
> eldap:present("objectClass")}, {attributes, ["description"]}]).
> {ok,{eldap_search_result,
>         [{eldap_entry,
>              <<"cn=Simon MacMullen,ou=people,dc=example,dc=com">>,
> [{<<"description">>,[<<"can-declare-queues">>]}]}],
>         []}}
>
> Now they come back as binaries. Is this intentional or a bug?
>
> Note that in either case if I give attribute names as binaries I get a 
> crash:
>
> 3> eldap:search(LDAP, [{base, "cn=Simon 
> MacMullen,ou=People,dc=example,dc=com"},{filter, 
> eldap:present("objectClass")}, {attributes, [<<"description">>]}]).
> {error,{function_clause,[{lists,thing_to_list,
>                                 [<<"description">>],
>                                 [{file,"lists.erl"},{line,601}]},
>
> {lists,flatmap,2,[{file,"lists.erl"},{line,1248}]},
>
> {lists,flatmap,2,[{file,"lists.erl"},{line,1248}]},
>                          {eldap,'-v_attributes/1-fun-0-',1,
>                                 [{file,"eldap.erl"},{line,850}]},
> {lists,map,2,[{file,"lists.erl"},{line,1237}]},
>
> {eldap,do_search_0,2,[{file,"eldap.erl"},{line,613}]},
>
> {eldap,do_search,2,[{file,"eldap.erl"},{line,577}]},
> {eldap,loop,2,[{file,"eldap.erl"},{line,425}]}]}}
>
> Cheers, Simon
>




More information about the erlang-questions mailing list