[ejabberd] mod_roster_ldap (replacing mnesia)

Stefan de Konink skinkie at xs4all.nl
Mon Dec 6 04:34:46 MSK 2004

Hi All,

Status update:

I have now a functional working LDAP roster backend and after some 
clean-ups it is going out to Leif Johansson to look over the Erlang 
code. Any other interested people are welcome to review the code too.
At the moment my concerns are 'evil' LDAP-injections and list/string 
conversions, all to be tested.

My question to the core developers:
mod_roster is in some places (very) hard coded. Small examples are 
ofcourse the 'module' callings by 'mod_roster:'. Big examples can be 
found in the webinterface which completely reimplements the mnesia code.
Is this going to change? On a negative response mod_roster_ldap should 
be going in as patch for mod_roster with LDAP functionality.

Next I will add add, modify and delete code to the mod_vcard_ldap module.

The first attached patch is to help other developers, it fixes the 
example ldap modify function in eldap.erl.

Probably something to look over too, previously I submitted a patch 
which added some functionality that could be not right. Should be partly 

-eldap:start_link("ejabberd_bind", LDAPServers, 389, RootDN, Password)
+eldap:start_link("ejabberd_bind", LDAPServers, 389)

(Because the later found bind function provides this information and the 
link shouldn't be initialized at all, my error)

Some other thing in the same file (not!) in the patch:
@@ -397,7 +397,8 @@
      Attr = ejabberd_config:get_local_option(ldap_uidattr),
      Filter = eldap:equalityMatch(Attr, User),
      Base = ejabberd_config:get_local_option(ldap_base),
-    case eldap:search("ejabberd", [{base, Base},
+    case eldap:search("ejabberd", [{scope, singleLevel},
+                                  {base, Base},
                                    {filter, Filter},
                                    {attributes, []}]) of
         #eldap_search_result{entries = [E | _]} ->

Changing the scope to single level prevents the user to bind under the 
deepest subtree, made my binding working again.


Stefan de Konink
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eldapdoc.patch
Type: text/x-patch
Size: 1011 bytes
Desc: not available
Url : http://lists.jabber.ru/pipermail/ejabberd/attachments/20041206/1dfbf80c/eldapdoc.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: revertback.patch
Type: text/x-patch
Size: 530 bytes
Desc: not available
Url : http://lists.jabber.ru/pipermail/ejabberd/attachments/20041206/1dfbf80c/revertback.bin

More information about the ejabberd mailing list