[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: entry has multiple objectClass attributes



>
> On Tuesday, January 7, 2003, at 06:06  PM, Pierangelo Masarati wrote:
>>
>>> I'm not sure if that is somehow equivalent to your top form. Is add
>>> generally a special case of modify, or is this only the case for the
>>> command line utilities?
>>
>> Add and modify are completely different LDAP operations; however, they
>> share the same description of attribute-value; assuming you're using
>> the C api, you need to provide an array of struct LDAPMod's whose
>> items contain the attribute types and the values for each
>> attribute.  In general, you can't specify each attribytre type
>> more than once in the array; if you have multiple value attributes,
>> you must add all the values in one occurrence of that attribute
>> in the LDAPMod array.  My guess is that you're passing your ldap_add()
>> an array of struct LDAPMod's that contains multiple occurrences of
>> objectClass rather than a single occurrence with multiple values.
>
> I'd agree that that's probably what's happening, the tricky part is
> that it's slurpd that's actually making the API calls which are
> failing, I'm just writing LDIF to a replog. The fact that the behaviour
> is different when I define updatedn in slapd.conf makes me think that
> slurpd is indeed doing something illegal (and in fact the code in slapd
> that pointed me at that as a potential fix is inside a #if
> SLURPD_FRIENDLY which makes me think that this is a
> not-quite-workaround for a known problem).

I note that slurpd, when parsing a replication log, actually creates
a LDAPMod for each value, rather than for each attribute.  I also
noted the SLURPD_FRIENDLY workaround you mentioned.  I wonder why
this has never been fixed (possiby because it's better not to fix
what currently works :).

> Note also that the same LDIF
> that makes slurpd make slapd barf works perfectly as input to the
> ldap_add command.

In act, slurpd turns a well-formatted ldif into a badly formatted one;
then slapd has a workaround to accept a badly formatted modification ...
very weird ...

P.M.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it