[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
uniqueness constraint violated when using ldapadd -M
- To: openldap-technical@openldap.org
- Subject: uniqueness constraint violated when using ldapadd -M
- From: Geert Hendrickx <geert@hendrickx.be>
- Date: Mon, 24 Aug 2015 15:25:23 +0200
- Content-disposition: inline
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=hendrickx.be; s=geert; t=1440422723; bh=6Bb4O9zEFWjVOkDdk6SV6PgCudxkRNWu8sBCmxrTNbo=; h=Date:From:To:Subject; b=A3ijs2vpKeZpivwVjNAX2SH19D2QVO6h8wR417t7I2jBVBMK7aRiPWHxpDYEs9Zy/ Be4jlmk6jT1kSayJzgNw641+TsyLBqDDbvtpcM6dZVFlGNZOYFfk2J54ocn1wMBkz4 BSJnKPHK/buRvqNQbaTrCSBDy9DSGdnn89hagisrb83QL7h5+Y0ebjn/IjmXtlJ73I ey/VLLjmih7n4w5jCod3dSelNMiaETzNwq4414l0y6o8TUnojnJCndcXTpV1m/E3nF JYyIXDxBFvAW03x2G1Daf+oEf9HXE4yR8+8oF6FISY5tSEd2M+loBY4TBCYr/6D43/ 6J/6mn78qz+CA==
- User-agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12)
Hi,
I noticed uniqueness constraints enforced by the slapo-unique overlay can
be bypassed when using the manage DSA IT control (ldapadd -M).
Using the following simple constraint:
overlay unique
unique_uri ldap:///?mail?sub
I get:
$ ldapadd -x -h localhost -D cn=Manager,dc=my-domain,dc=com -w secret
dn: cn=test1,dc=my-domain,dc=com
objectClass: inetOrgPerson
cn: test1
sn: test1
mail: test@my-domain.com
adding new entry "cn=test1,dc=my-domain,dc=com"
dn: cn=test2,dc=my-domain,dc=com
objectClass: inetOrgPerson
cn: test2
sn: test2
mail: test@my-domain.com <===== duplicate, violates uniqueness constraint
adding new entry "cn=test2,dc=my-domain,dc=com"
ldap_add: Constraint violation (19)
additional info: some attributes not unique <===== ok, as expected
Retrying with -M
$ ldapadd -M -x -h localhost -D cn=Manager,dc=my-domain,dc=com -w secret
dn: cn=test2,dc=my-domain,dc=com
objectClass: inetOrgPerson
cn: test2
sn: test2
mail: test@my-domain.com <===== duplicate, violates uniqueness constraint
adding new entry "cn=test2,dc=my-domain,dc=com" <===== but it is accepted?
$ ldapsearch -x -h localhost -b dc=my-domain,dc=com mail=test@my-domain.com
# extended LDIF
#
# LDAPv3
# base <dc=my-domain,dc=com> with scope subtree
# filter: mail=test@my-domain.com
# requesting: ALL
#
# test1, my-domain.com
dn: cn=test1,dc=my-domain,dc=com
objectClass: inetOrgPerson
cn: test1
sn: test1
mail: test@my-domain.com
# test2, my-domain.com
dn: cn=test2,dc=my-domain,dc=com
objectClass: inetOrgPerson
cn: test2
sn: test2
mail: test@my-domain.com
# search result
search: 2
result: 0 Success
# numResponses: 3
# numEntries: 2
The uniqueness constraint has been violated when using -M, while it was
correctly enforced without -M.
Feature or bug?
Geert
--
geert.hendrickx.be :: geert@hendrickx.be :: PGP: 0xC4BB9E9F
This e-mail was composed using 100% recycled spam messages!