Le 22/02/16 21:02, Stefan Seelmann a écrit :
> Hi,
>
> I'm currently looking into DIRSTUDIO-987. The latest comment shows an
> multi-valued RDN which uses the same attribute multiple times:
>
>     dn: l=eu + l=de + l=Berlin + l=Brandenburger Tor, ...
>
> Is that valid? Our Rdn class doesn't allow that. RFC 4512 section 2.3.1
> doesn't forbid that.
>
> Kind Regards,
> Stefan
IMO, we should accept such DN. There is nothing in the RFC that
explicitely forbid it.

The code that checks that an AVA is not already in use can be found in
teh AVA class :


    /* Unspecified protection */void addAVA( SchemaManager
schemaManager, Ava value ) throws LdapInvalidDnException

            ...
            case 1:
                // We already have an Ava. We have to put it in the HashMap
                // before adding a new one.
                // Check that the first AVA is not for the same attribute
                if ( avaType.equals( normalizedType ) )
                {
                    throw new LdapInvalidDnException( "Invalid RDN: the
" + normalizedType
                        + " is already present in the RDN" );
                }
            ...
            default:
                // Check that the AT is not already present
                if ( avaTypes.containsKey( normalizedType ) )
                {
                    throw new LdapInvalidDnException( "Invalid RDN: the
" + normalizedType
                        + " is already present in the RDN" );
                }
            ...

In order to fix the bad behaviour, we would have to change the way we
feed the avaTyps, which is a multiMap anyway (ie, teh key is associated
to a list, so adding a new value would work).



Reply via email to