ejabberd - Comments for "mod_shared_roster_ldap" https://www.ejabberd.im/node/4233 en Try the following patch: --- https://www.ejabberd.im/node/4233#comment-56594 <p>Try the following patch:</p> <div class="codeblock"><code>--- a/src/mod_shared_roster_ldap_helpers.erl<br />+++ b/src/mod_shared_roster_ldap_helpers.erl<br />@@ -118,9 +118,13 @@ group_entries_to_dict(GroupIDAttr, GroupDescAttr, GroupMemberAttr, Host, Extract<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JIDs = lists:foldl(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fun({ok, UID}, L) -&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PUID = jlib:nodeprep(UID),<br />-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case AuthProcessor(PUID, Host) of<br />-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (_, L) -&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; L</code></div> Sat, 04 Sep 2010 16:24:59 +0000 porridge comment 56594 at https://www.ejabberd.im First of all, if you want me https://www.ejabberd.im/node/4233#comment-56593 <p>First of all, if you want me to notice, please report mod_shared_roster_ldap issues in <a href="http://www.ejabberd.im/mod_shared_roster_ldap" title="http://www.ejabberd.im/mod_shared_roster_ldap">http://www.ejabberd.im/mod_shared_roster_ldap</a> or (better yet) the bug tracker in <noindex><a href="https://alioth.debian.org/projects/ejabberd-msrl/" title="https://alioth.debian.org/projects/ejabberd-msrl/" rel="nofollow" >https://alioth.debian.org/projects/ejabberd-msrl/</a></noindex></p> <p>It seems this error condition has taken place because ejabberd_auth:is_user_exists/2 was called with atom `error` (NOT string "error") in group_entries_to_dict (line "case AuthProcessor(PUID, Host) of").</p> <p>This in turn seems can only happen when jlib:nodeprep/1 returns the atom `error` for some reason.</p> <p>The trace is so long because in branch 2.1.x the atom triggers an error condition deep within eldap_filter's guts. This should be easier to spot in the trunk code, as is_user_exists has an is_list() guard.</p> <p>As for why nodeprep() can return `error` - one case might be when the UID is over 1KiB long. I suspect that is what happens in your case. I'll try to come up with a patch to cover that case by simply ignoring such long usernames.</p> <p>However you'll be better off by tweaking your LDAP filters not to return useless entries in the first place.</p> Sat, 04 Sep 2010 15:58:53 +0000 porridge comment 56593 at https://www.ejabberd.im i have applied this patch: https://www.ejabberd.im/node/4233#comment-56575 <p>i have applied this patch: <noindex><a href="http://github.com/processone/ejabberd/commit/3024bb0cbf359f3e14b5386ed14ecfb168e8a267" title="http://github.com/processone/ejabberd/commit/3024bb0cbf359f3e14b5386ed14ecfb168e8a267" rel="nofollow" >http://github.com/processone/ejabberd/commit/3024bb0cbf359f3e14b5386ed14...</a></noindex><br /> now the error message looks like this:</p> <p>=ERROR REPORT==== 2010-08-31 09:28:18 ===<br /> E(&lt;0.453.0&gt;:ejabberd_auth:256) : The authentication module ejabberd_auth_ldap returned an error<br /> when checking user error in server "example.com"<br /> Error message: {{case_clause,<br /> {'EXIT',<br /> {function_clause,<br /> [{lists,flatmap,<br /> [#Fun,error]},<br /> {eldap_filter,do_sub,2},<br /> {eldap_filter,check,2},<br /> {eldap_filter,scan,5},<br /> {eldap_filter,parse,2},<br /> {ejabberd_auth_ldap,find_user_dn,2},<br /> {ejabberd_auth_ldap,is_user_exists_ldap,2},<br /> {ejabberd_auth_ldap,is_user_exists,2}]}}},<br /> [{eldap_filter,parse,2},<br /> {ejabberd_auth_ldap,find_user_dn,2},<br /> {ejabberd_auth_ldap,is_user_exists_ldap,2},<br /> {ejabberd_auth_ldap,is_user_exists,2},<br /> {ejabberd_auth,'-is_user_exists/2-fun-0-',3},<br /> {lists,any,2},<br /> {mod_shared_roster_ldap_helpers,<br /> '-group_entries_to_dict/7-fun-0-',4},<br /> {lists,foldl,3}]}</p> Tue, 31 Aug 2010 07:32:05 +0000 newc0mer comment 56575 at https://www.ejabberd.im I think beams can be compressed https://www.ejabberd.im/node/4233#comment-56574 <div class="quote-msg"> <div class="quote-author"><em>newc0mer</em> wrote:</div> <p>something other I think that it is strange:<br /> file mod_shared_roster.beam: gzip compressed data, from Unix<br /> file mod_shared_roster_ldap.beam: data<br /> file mod_shared_roster_ldap_helpers.beam: data<br /> file mod_sic.beam: gzip compressed data, from Unix</p> <p>all files are gzip compressed, except the ones I have compiled manually.</p></div> <p>I think the beam files included in ejabberd binary packages are usually compiled with an additional compression option.</p> Mon, 30 Aug 2010 22:09:58 +0000 mfoss comment 56574 at https://www.ejabberd.im i^ve downloaded the lastest https://www.ejabberd.im/node/4233#comment-56566 <p>i^ve downloaded the lastest ejabberd (2.1.5) and compiled eveything manually. It looks better now - at least I get an error msg:<br /> =ERROR REPORT==== 2010-08-30 14:55:08 ===<br /> E(&lt;0.355.0&gt;:ejabberd_auth:256) : The authentication module ejabberd_auth_ldap returned an error<br /> when checking user error in server "example.com"<br /> Error message: {{case_clause,<br /> {'EXIT',<br /> {function_clause,<br /> [{lists,map,[#Fun,error]},<br /> {eldap_filter,do_sub,2},<br /> {eldap_filter,check,2},<br /> {eldap_filter,scan,5},<br /> {eldap_filter,parse,2},<br /> {ejabberd_auth_ldap,find_user_dn,2},<br /> {ejabberd_auth_ldap,is_user_exists_ldap,2},<br /> {ejabberd_auth_ldap,is_user_exists,2}]}}},<br /> [{eldap_filter,parse,2},<br /> {ejabberd_auth_ldap,find_user_dn,2},<br /> {ejabberd_auth_ldap,is_user_exists_ldap,2},<br /> {ejabberd_auth_ldap,is_user_exists,2},<br /> {ejabberd_auth,'-is_user_exists/2-fun-0-',3},<br /> {lists,any,2},<br /> {mod_shared_roster_ldap_helpers,<br /> '-group_entries_to_dict/7-fun-0-',4},<br /> {lists,foldl,3}]}</p> <p>probably someone knows more about this error?</p> Mon, 30 Aug 2010 13:00:05 +0000 newc0mer comment 56566 at https://www.ejabberd.im something other I think that https://www.ejabberd.im/node/4233#comment-56556 <p>something other I think that it is strange:<br /> file mod_shared_roster.beam: gzip compressed data, from Unix<br /> file mod_shared_roster_ldap.beam: data<br /> file mod_shared_roster_ldap_helpers.beam: data<br /> file mod_sic.beam: gzip compressed data, from Unix</p> <p>all files are gzip compressed, except the ones I have compiled manually.. i followed these steps to create them:<br /> <noindex><a href="http://ejabberd-msrl.alioth.debian.org/doc/0.5.1/msrl.html#htoc7" title="http://ejabberd-msrl.alioth.debian.org/doc/0.5.1/msrl.html#htoc7" rel="nofollow" >http://ejabberd-msrl.alioth.debian.org/doc/0.5.1/msrl.html#htoc7</a></noindex></p> <p>btw: there was no error/success message at the point i've compiled the files with erlc... it just made the .beam files...</p> Thu, 26 Aug 2010 13:42:54 +0000 newc0mer comment 56556 at https://www.ejabberd.im