Crash when search users in LDAP

Hi.

Download and install ejabberd 14.05 in my Ubuntu 14.04 x86.

I am use LDAP authentication and vCard (Microsoft AD 2003) in ejabberd. Work fine. But search users in LDAP not working.

=CRASH REPORT==== 21-May-2014::13:47:27 ===
  crasher:
    initial call: eldap:init/1
    pid: <0.390.0>     
    registered_name: 'eldap_#Ref<0.0.0.11185>'
    exception exit: {{badmatch,
                      {error,
                       {asn1,
                        {function_clause,
                         [{'ELDAPv3',
                           enc_SubstringFilter_substrings_components,
                           [{'SubstringFilter_substrings',[{any,<<"test">>}]},
                            [],0],
                           [{file,"src/ELDAPv3.erl"},{line,1768}]},
                          {'ELDAPv3',enc_SubstringFilter_substrings,2,
                           [{file,"src/ELDAPv3.erl"},{line,1765}]},
                          {'ELDAPv3',enc_SubstringFilter,2,
                           [{file,"src/ELDAPv3.erl"},{line,1753}]},
                          {'ELDAPv3',enc_Filter,2,
                           [{file,"src/ELDAPv3.erl"},{line,1604}]},
                          {'ELDAPv3',enc_Filter_and_components,3,
                           [{file,"src/ELDAPv3.erl"},{line,1636}]},
                          {'ELDAPv3',enc_Filter_and,2,
                           [{file,"src/ELDAPv3.erl"},{line,1629}]},
                          {'ELDAPv3',enc_Filter,2,
                           [{file,"src/ELDAPv3.erl"},{line,1596}]},
                          {'ELDAPv3',enc_SearchRequest,2,
                           [{file,"src/ELDAPv3.erl"},{line,1511}]}]}}}},
                     [{eldap,send_command,3,
                       [{file,"src/eldap.erl"},{line,831}]},
                      {eldap,process_command,3,
                       [{file,"src/eldap.erl"},{line,813}]},
                      {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,505}]},
                      {proc_lib,init_p_do_apply,3,
                       [{file,"proc_lib.erl"},{line,239}]}]}
      in function  gen_fsm:terminate/7 (gen_fsm.erl, line 622)
    ancestors: ['ejabberd_mod_vcard_ldap_mydomain.ru',ejabberd_sup,<0.38.0>]
    messages: []
    links: [<0.386.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 1598
    stack_size: 27
    reductions: 1741
  neighbours:
    neighbour: [{pid,<0.391.0>},
                  {registered_name,'eldap_#Ref<0.0.0.11197>'},
                 {initial_call,{eldap,init,['Argument__1']}},
                  {current_function,{gen_fsm,loop,7}},
                  {ancestors,['ejabberd_mod_vcard_ldap_mydomain.ru',
                              ejabberd_sup,<0.38.0>]},
                  {messages,[]},
                  {links,[<0.386.0>]},
                  {dictionary,[]},
                  {trap_exit,false},
                  {status,waiting},
                  {heap_size,2586},
                  {stack_size,10},
                  {reductions,4622}]
    neighbour: [{pid,<0.386.0>},
                  {registered_name,'ejabberd_mod_vcard_ldap_mydomain.ru'},
                  {initial_call,{mod_vcard_ldap,init,['Argument__1']}},
                  {current_function,{gen_server,loop,6}},
                  {ancestors,[ejabberd_sup,<0.38.0>]},
                  {messages,[]},
                  {links,[<0.390.0>,<0.391.0>,<0.296.0>]},
                  {dictionary,[]},
                  {trap_exit,false},
                  {status,waiting},
                  {heap_size,987},
                  {stack_size,9},
                  {reductions,1250}]

My config about LDAP:

{host_config, "mydomain.ru", [{auth_method, ldap},
    {ldap_servers, ["dc.mydomain.local"]},
    {ldap_encrypt, tls},
    {ldap_tls_verify, soft},
    {ldap_tls_cacertfile, "/opt/ejabberd/conf/mydomain.ru_ssl/mydomain-ca.pem"},
    {ldap_rootdn, "CN=LDAP_user,OU=Services,DC=mydomain,DC=local"},
    {ldap_password, "*****"},
    {ldap_base, "DC=mydomain,DC=local"},
    {ldap_uids, [{"sAMAccountName"}]}
]}.

{host_config, "mydomain.ru", [
  {{add, modules}, [
    {mod_vcard_ldap, [
      {host, "search.@HOST@"},
      {ldap_vcard_map, [
        {"NICKNAME", "%u", []},
        {"GIVEN", "%s", ["givenName"]},
        {"MIDDLE", "%s", ["initials"]},
        {"FAMILY", "%s", ["sn"]},
        {"FN", "%s", ["displayName"]},
        {"EMAIL", "%s", ["mail"]},
        {"ORGNAME", "%s", ["company"]},
        {"ORGUNIT", "%s", ["department"]},
        {"TITLE", "%s", ["title"]},
        {"DESC", "%s", ["description"]},
        {"TEL", "%s", ["telephoneNumber"]}
      ]},
      {ldap_search_fields, [
        {"User", "userPrincipalName"},
        {"Givenname", "givenName"},
        {"Family Name", "sn"},
        {"Email", "mail"}
      ]},
      {ldap_search_reported, [
        {"Full Name", "FN"},
        {"Nickname", "NICKNAME"},
        {"Email", "EMAIL"}
      ]}
    ]}
  ]}
]}.

This config working width ejabberd 2.1.10 from Ubuntu reps.

P.S. Yes I know {add, modules} is deprecated, but I really do not know how to properly use append_host_config in my config (not YAML).

P.P.S I just installed ejabberd 2.1.13 and it works fine.

Syndicate content