You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@iktek.com> on 2005/02/19 19:57:12 UTC

Re: [jira] Resolved: (DIRLDAP-35) LdapName comparison must be case-insensitive for attibutType

Sorry, vincent, but I think that it's no enough to compareToIgnoreCase
on each RDN. We had a very intersting chat session 2 weeks ago with Alex
and Alan, and as far as I remember, one *must* compare RDN attributes in
a CIS way, BUT check for RDN values matching rules befare stating that
two DNs are equals.  For instance :

A=V1, b=V2 == a=V1, b=v2 if and only if :
1) each RDN should be present in both DN
2) each RDN should be at the same position in both DN
3) each RDN attributes name should be CIS-equals
4) each RDN Values shlould be equals using the matching rule of its RDN
attribute
5) if a RDN has more than one attribute, all of thoses attributes and
values should be equals with those on the other RDN, but the attributes
order is of no importance.

for instance :
A=V1 		equals a=V1
A=V1, B=V2 	equals a=V1, b=V2
A=V1 + B=V2	equals b=V2 + a=V1

but :
A=V1 equals A=v1 only if A matching rule is case insensitive


Le samedi 19 février 2005 à 19:32 +0100, Vincent Tence (JIRA) a écrit :
>      [ http://issues.apache.org/jira/browse/DIRLDAP-35?page=history ]
>      
> Vincent Tence resolved DIRLDAP-35:
> ----------------------------------
> 
>       Assign To: Vincent Tence  (was: Alex Karasulu)
>      Resolution: Fixed
>     Fix Version: 0.8.1
> 
> This should be fixed now in the trunk thanks to your TestCase. Good work Emmanuel!
> 
> > LdapName comparison must be case-insensitive for attibutType
> > ------------------------------------------------------------
> >
> >          Key: DIRLDAP-35
> >          URL: http://issues.apache.org/jira/browse/DIRLDAP-35
> >      Project: Directory LDAP
> >         Type: Bug
> >   Components: Common
> >     Reporter: Emmanuel Lecharny
> >     Assignee: Vincent Tence
> >      Fix For: 0.8.1
> 
> >
> > While comparing two DNs, the AttributeType of each RDN must be compared in a case-insensitive way : RFC 2251, chap. 4.1.4, par.4.
> > It could be tricky to perform a valid comparison :
> > A=V1+B=V2,C=GB and A=V1+b=V2,C=GB are equals in regards with the RFC,
> > A=V1+B=V2,C=GB and A=V1+C=V2,C=GB are differents in regards with the RFC.
> > LdapName.compareTo function does not return a valid result :
> >         Name n1 = new DnParser().parse("A=V");
> >         Name n2 = new DnParser().parse("a=V");
> >         int val = n1.compareTo(n2);  // val = 0xffffffe0 instead of 0
> 



Re: [jira] Resolved: (DIRLDAP-35) LdapName comparison must be case-insensitive for attibutType

Posted by Alex Karasulu <ao...@bellsouth.net>.
Emmanuel Lecharny wrote:

>Sorry, vincent, but I think that it's no enough to compareToIgnoreCase
>on each RDN. We had a very intersting chat session 2 weeks ago with Alex
>and Alan, and as far as I remember, one *must* compare RDN attributes in
>a CIS way, BUT check for RDN values matching rules befare stating that
>two DNs are equals.  For instance :
>
>A=V1, b=V2 == a=V1, b=v2 if and only if :
>1) each RDN should be present in both DN
>2) each RDN should be at the same position in both DN
>3) each RDN attributes name should be CIS-equals
>4) each RDN Values shlould be equals using the matching rule of its RDN
>attribute
>5) if a RDN has more than one attribute, all of thoses attributes and
>values should be equals with those on the other RDN, but the attributes
>order is of no importance.
>
>for instance :
>A=V1 		equals a=V1
>A=V1, B=V2 	equals a=V1, b=V2
>A=V1 + B=V2	equals b=V2 + a=V1
>
>but :
>A=V1 equals A=v1 only if A matching rule is case insensitive
>
>  
>
You are totally right here Emmanuel.  RDN attribute identifiers must be 
matched without case sensitivity. 

-Alex

>Le samedi 19 février 2005 à 19:32 +0100, Vincent Tence (JIRA) a écrit :
>  
>
>>     [ http://issues.apache.org/jira/browse/DIRLDAP-35?page=history ]
>>     
>>Vincent Tence resolved DIRLDAP-35:
>>----------------------------------
>>
>>      Assign To: Vincent Tence  (was: Alex Karasulu)
>>     Resolution: Fixed
>>    Fix Version: 0.8.1
>>
>>This should be fixed now in the trunk thanks to your TestCase. Good work Emmanuel!
>>
>>    
>>
>>>LdapName comparison must be case-insensitive for attibutType
>>>------------------------------------------------------------
>>>
>>>         Key: DIRLDAP-35
>>>         URL: http://issues.apache.org/jira/browse/DIRLDAP-35
>>>     Project: Directory LDAP
>>>        Type: Bug
>>>  Components: Common
>>>    Reporter: Emmanuel Lecharny
>>>    Assignee: Vincent Tence
>>>     Fix For: 0.8.1
>>>      
>>>
>>>While comparing two DNs, the AttributeType of each RDN must be compared in a case-insensitive way : RFC 2251, chap. 4.1.4, par.4.
>>>It could be tricky to perform a valid comparison :
>>>A=V1+B=V2,C=GB and A=V1+b=V2,C=GB are equals in regards with the RFC,
>>>A=V1+B=V2,C=GB and A=V1+C=V2,C=GB are differents in regards with the RFC.
>>>LdapName.compareTo function does not return a valid result :
>>>        Name n1 = new DnParser().parse("A=V");
>>>        Name n2 = new DnParser().parse("a=V");
>>>        int val = n1.compareTo(n2);  // val = 0xffffffe0 instead of 0
>>>      
>>>
>
>
>
>  
>


Re: [jira] Resolved: (DIRLDAP-35) LdapName comparison must be case-insensitive for attibutType

Posted by Vincent Tence <vt...@videotron.ca>.
>> but :
>> A=V1 equals A=v1 only if A matching rule is case insensitive

Are you're saying case sensitivity depends on attribute type? In which 
case the test I added is not correct (even if cn comparison is case 
sensitive, the test name is misleading).

- Vincent

Re: [jira] Resolved: (DIRLDAP-35) LdapName comparison must be case-insensitive for attibutType

Posted by Vincent Tence <vt...@videotron.ca>.
Yep. I figured that out myself. I've added a test case to prove 
attribute value comparison is case sensitive. 2 other tests are 
currently commented out for dealing with multi-valued RDN comparison.

I don't have sufficient understanding of both Ldap Name syntax rule and 
the code base to correct this right now. It looks to me though that the 
current implementation of LDAPName does not permit an easy fix of this.
It would be easier if the antlr parser could deal with multiple values. 
You're saying you have already discussed this issue. Did you guys think 
of any solution to this problem?

- Vincent



Emmanuel Lecharny wrote:
> Sorry, vincent, but I think that it's no enough to compareToIgnoreCase
> on each RDN. We had a very intersting chat session 2 weeks ago with Alex
> and Alan, and as far as I remember, one *must* compare RDN attributes in
> a CIS way, BUT check for RDN values matching rules befare stating that
> two DNs are equals.  For instance :
> 
> A=V1, b=V2 == a=V1, b=v2 if and only if :
> 1) each RDN should be present in both DN
> 2) each RDN should be at the same position in both DN
> 3) each RDN attributes name should be CIS-equals
> 4) each RDN Values shlould be equals using the matching rule of its RDN
> attribute
> 5) if a RDN has more than one attribute, all of thoses attributes and
> values should be equals with those on the other RDN, but the attributes
> order is of no importance.
> 
> for instance :
> A=V1 		equals a=V1
> A=V1, B=V2 	equals a=V1, b=V2
> A=V1 + B=V2	equals b=V2 + a=V1
> 
> but :
> A=V1 equals A=v1 only if A matching rule is case insensitive
> 
> 
> Le samedi 19 février 2005 à 19:32 +0100, Vincent Tence (JIRA) a écrit :
> 
>>     [ http://issues.apache.org/jira/browse/DIRLDAP-35?page=history ]
>>     
>>Vincent Tence resolved DIRLDAP-35:
>>----------------------------------
>>
>>      Assign To: Vincent Tence  (was: Alex Karasulu)
>>     Resolution: Fixed
>>    Fix Version: 0.8.1
>>
>>This should be fixed now in the trunk thanks to your TestCase. Good work Emmanuel!
>>
>>
>>>LdapName comparison must be case-insensitive for attibutType
>>>------------------------------------------------------------
>>>
>>>         Key: DIRLDAP-35
>>>         URL: http://issues.apache.org/jira/browse/DIRLDAP-35
>>>     Project: Directory LDAP
>>>        Type: Bug
>>>  Components: Common
>>>    Reporter: Emmanuel Lecharny
>>>    Assignee: Vincent Tence
>>>     Fix For: 0.8.1
>>
>>>While comparing two DNs, the AttributeType of each RDN must be compared in a case-insensitive way : RFC 2251, chap. 4.1.4, par.4.
>>>It could be tricky to perform a valid comparison :
>>>A=V1+B=V2,C=GB and A=V1+b=V2,C=GB are equals in regards with the RFC,
>>>A=V1+B=V2,C=GB and A=V1+C=V2,C=GB are differents in regards with the RFC.
>>>LdapName.compareTo function does not return a valid result :
>>>        Name n1 = new DnParser().parse("A=V");
>>>        Name n2 = new DnParser().parse("a=V");
>>>        int val = n1.compareTo(n2);  // val = 0xffffffe0 instead of 0
>>
> 
>