FAIL
FAIL
FAIL
+FAIL
+FAIL
+FAIL
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: example@not-allowed.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail
mail: original@example.com
--- /dev/null
+dn: cn=John Doe,dc=example,dc=com
+changetype: modify
+delete: mail
+mail: original@example.com
+-
+add: mail
+mail: notsooriginal@example.com
+-
+replace: cn
+cn: John Fail
--- /dev/null
+dn: cn=John Doe,dc=example,dc=com
+changetype: modify
+replace: givenname
+givenname: Joe
--- /dev/null
+dn: cn=John Doe,dc=example,dc=com
+changetype: modify
+replace: sn
+sn: Down
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: a@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail
-
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: mail
-
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
replace: mail
mail: a@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
add: mail
mail: b@example.com
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
changetype: modify
delete: description
description: desc1
-dn: cn=user,dc=example,dc=com
+dn: cn=John Doe,dc=example,dc=com
objectclass: inetOrgPerson
objectclass: organizationalPerson
-cn: John
+cn: John Doe
+givenname: John
sn: Doe
mail: original@example.com
description: desc1
USERLDIF="$CONSTRAINTDIR/user.ldif"
RESULTOUT="$CONSTRAINTDIR/constraint.out"
SCRIPTOUT="$TESTDIR/constraint.out"
-USERDN="cn=user,$BASEDN"
+USERDN="cn=John Doe,$BASEDN"
CONFDIR=$TESTDIR/slapd.d
mkdir -p $TESTDIR $CONFDIR $DBDIR1
olcConstraintAttribute: mail count 3
olcConstraintAttribute: mail regex ^[[:alnum:]]+@example.com$
olcConstraintAttribute: description count 2
+# cn value has to be concatenated givenName SP sn
+olcConstraintAttribute: cn,sn,givenName
+ set "(this/givenName + [ ] + this/sn) & this/cn"
+ restrict="ldap:///$USERDN??sub?(objectClass=inetOrgPerson)"
EOF
$SLAPADD -F $CONFDIR -n 0 -l $TESTDIR/config.ldif
echo "Running constraint tests..."
for ldif in $SRCDIR/data/constraint/{*ok*,*fail*}.ldif; do
### reload
- $LDAPDELETE -D "$MANAGERDN" -H $URI1 -w $PASSWD $USERDN &>/dev/null
+ $LDAPDELETE -D "$MANAGERDN" -H $URI1 -w $PASSWD "$USERDN" &>/dev/null
RC=$?
if test $RC != 0 ; then
echo "ldapdelete failed ($RC)!"