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

Re: issues with equality matching and slapd death



On 9/28/18 10:11 AM, Quanah Gibson-Mount wrote:
If you read back on my earlier responses, you'll note I mentioned "normalization" of the values.

Basic breakdown:

If an attribute is defined in the schema with an EQUALITY rule, then the values get normalized. If an attribute is defined in the schema without an EQUALITY rule, there are no normalized values.

Case a: Normalized values

You can use changetype: modify + add to add value(s) to an attribute because slapd has the knowledge with which to check for duplicate values based on the EQUALITY rule.

Case b: No normalized values

You cannot use changetype: modify + add to add value(s) to an attribute because slapd has no knowledge about whether or not there are duplicate values.  You must use changetype: modify + replace.

I.e., if I have:

dn: uid=joe,cn=people,dc=example,dc=com
mail: joe@example.com

And in this case "mail" has no EQUALITY rule, if I try to do:

dn: uid=joe,cn=people,dc=example,dc=com
changetype: modify
add: joe@example2.com

it will fail, because there are no normalized values that slapd can use to ensure I'm not adding a duplicate to what already exists.  Instead, I must do:

dn: uid=joe,cn=people,dc=example,dc=com
changetype: modify
replace: mail
mail: joe@example.com
mail: joe@example2.com


Hope that helps.

--Quanah

Hi Quanah,

Yes that does help. Thank you. So now then based on our understanding here, do you agree then that the best solution here is to update the schema and then make sure the data is normalized, via export/import aka slapcat/slapadd, and subsequent data manipulations (assuming the feasibility) as needed?

CP