ejabberd - Comments for "How can I make eJabberd correctly use the ldap_filter attribute ?" https://www.ejabberd.im/node/3609 en Well, in the meantime I https://www.ejabberd.im/node/3609#comment-54543 <p>Well, in the meantime I explored other tracks that could lead to explain the problem, and I think I have found the real cause which is not related to eJabberd, but to LDAP itself.</p> <p>The thing is in fact quite simple : what I want to do is just not possible. That is because in the schema file (nis.schema) that defines the uidNumber, this attribute has no ORDERING instruction, thus it is not possible to do a search based on ordering comparisons. </p> <p>And since this is defined in an RFC, it is not possible to make it change unless the RFC itself is updated, which is quite a heavy process. Finally, this attribute is part of the standard since the X.501 time and it seems like the community is very reluctant in changing any such attributes.</p> <p><noindex><a href="http://www.openldap.org/lists/openldap-software/200203/msg00181.html" title="http://www.openldap.org/lists/openldap-software/200203/msg00181.html" rel="nofollow" >http://www.openldap.org/lists/openldap-software/200203/msg00181.html</a></noindex><br /> <noindex><a href="http://www.openldap.org/lists/openldap-bugs/200607/msg00081.html" title="http://www.openldap.org/lists/openldap-bugs/200607/msg00081.html" rel="nofollow" >http://www.openldap.org/lists/openldap-bugs/200607/msg00081.html</a></noindex></p> <p>I guess I will have to find another way to do what I wanted to.</p> Fri, 14 Aug 2009 06:50:29 +0000 Gemini comment 54543 at https://www.ejabberd.im 1. Here is what I get within https://www.ejabberd.im/node/3609#comment-54542 <p>1. Here is what I get within the erl interpreter:</p> <div class="codeblock"><code># erl<br />Erlang (BEAM) emulator version 5.6.5 [source] [async-threads:0] [hipe] [kernel-poll:false] <p>Eshell V5.6.5&nbsp; (abort with ^G)<br />1&gt; eldap_filter:parse(&quot;(uidNumber&gt;=500)&quot;).<br />{ok,{greaterOrEqual,{&#039;AttributeValueAssertion&#039;,&quot;uidNumber&quot;,<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;500&quot;}}}<br />2&gt;eldap_filter:parse(&quot;(&amp;(uid=gemini)(uidNumber&gt;=500))&quot;).<br />{ok,{&#039;and&#039;,[{equalityMatch,{&#039;AttributeValueAssertion&#039;,&quot;uid&quot;,<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;gemini&quot;}},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {greaterOrEqual,{&#039;AttributeValueAssertion&#039;,&quot;uidNumber&quot;,<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;500&quot;}}]}}</p></code></div> <p>2. After setting the log level to 5, I have this as output in the log concerning my login attempt:</p> <div class="codeblock"><code>=INFO REPORT==== 2009-08-14 06:34:09 ===<br />D(&lt;0.268.0&gt;:eldap:593) : {searchRequest,<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; {&#039;SearchRequest&#039;,<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; &quot;ou=personnes,dc=sanctuaire,dc=fr,dc=eu,dc=org&quot;,<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; wholeSubtree,neverDerefAliases,0,0,false,<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; {&#039;and&#039;,<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; [{equalityMatch,<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; {&#039;AttributeValueAssertion&#039;,&quot;uid&quot;,&quot;gemini&quot;}},<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; {greaterOrEqual,<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; {&#039;AttributeValueAssertion&#039;,&quot;uidNumber&quot;,&quot;500&quot;}}]},<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; []}} <p>=INFO REPORT==== 2009-08-14 06:34:09 ===<br />D(&lt;0.268.0&gt;:eldap:654) : {searchResDone,<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; {&#039;LDAPResult&#039;,success,[],[],asn1_NOVALUE}}</p> <p>=INFO REPORT==== 2009-08-14 06:34:09 ===<br />I(&lt;0.430.0&gt;:ejabberd_c2s:576) : ({socket_state,tls,{tlssock,#Port&lt;0.1502&gt;,#Port&lt;0.1518&gt;},&lt;0.429.0&gt;}) Failed authentication for gemini@blabla</p></code></div> <p>As for wireshark, I'm really not good at using it ^^</p> Fri, 14 Aug 2009 06:32:20 +0000 Gemini comment 54542 at https://www.ejabberd.im Re: How can I make eJabberd correctly use the ldap_filter https://www.ejabberd.im/node/3609#comment-54541 <p>Seems like a bug, but I can't reproduce it. Could you please run the following tests?</p> <p>1. Find ejabberd directory with BEAM files. Make sure there is eldap_filter.beam in that directory. cd there and type:</p> <div class="codeblock"><code>$ erl<br />1&gt; eldap_filter:parse(&quot;(uidNumber&gt;=500)&quot;).<br />2&gt; eldap_filter:parse(&quot;(&amp;(uid=gemini)(uidNumber&gt;=500))&quot;).</code></div> <p>2. Set log level to 5 (debug). Try to authenticate. Show an output of resulting log with LDAP messages.<br /> 3. Run "wireshark" and look into LDAP messages. Do you see an incorrect filter there?</p> <p>If we find a bug we can fix it before 2.1.0 release.</p> Fri, 14 Aug 2009 03:46:59 +0000 zinid comment 54541 at https://www.ejabberd.im