[Freeipa-devel] [PATCH] Check if attribute is single-value before trying to add values to it.

Pavel Zuna pzuna at redhat.com
Thu Oct 14 13:24:22 UTC 2010


On 10/14/2010 12:01 AM, Rob Crittenden wrote:
> Pavel Zuna wrote:
>> This patch adds a check in ldap2 for single-value attributes. DS doesn't
>> seem to care much about attributes being defined as SINGLE-VALUE except
>> for things like uidNumber and gidNumber (I suspect this is handled by
>> the DNA plugin).
>>
>> Ticket #246
>>
>> Pavel
>
> This is similar to ticket 220 which I have a pending patch for (patch
> 552). I think both patches are valid but we should test them together to
> be sure. Can you do that?
>
> rob

I had to NACK your patch number 552, because the check was in the wrong place.

Both patches overlap in functionality, so I decided to merge them into a new 
version of my original patch.

I split the single-value check into two parts:

First part is in baseldap classes (LDAPCreate, LDAPUpdate) and it checks if 
we're not trying to add more values to a Param defined attribute, that is not 
flagged as multivalue.

Second part is in the ldap2 backend. It checks if we're not trying to add more 
values to an attribute, that is defined as SINGLE-VALUE in the schema. 
Unfortunately, it seems that python-ldap isn't capable of reporting the 
SINGLE-VALUE flag reliably and DS doesn't enforce it at all. In other words, 
this check is a bit weak, but still better than nothing.

I hope you don't mind I merged both patches, but it seemed simpler and we can 
knock out 2 tickets in one commit. :)

Ticket #230
Ticket #246

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pzuna-freeipa-0032-2-singlevalue.patch
Type: text/x-patch
Size: 8022 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20101014/b561ccef/attachment.bin>


More information about the Freeipa-devel mailing list