From ca4e0c8539e5b0e01ca9d68eba8692c544d7a4d6 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 17 May 2005 21:43:47 +0000 Subject: r6867: this code will change the way the @ATTRIBUTES object is handled this object properties are now used as multivalue attributes now all values inserted are checked against a "valid values table" eg: this form is now accepted: dn: @ATTRIBUTES uid: CASE_INSENSITIVE uid: WILDCARD this form is now rejected: dn: @ATTRIBUTES uid: CASE_INSENSITIVE WILDCARD please update your .ldb files if you make use of @ATTRIBUTES (sam.ldb heavily uses it) the code passes all make test tests for both tdb and ldap, it also passes the new test to check for wrong @ATTRIBUTES attribute values Simo. (This used to be commit 1295b891a26c2cb2c34540f90ded83390cf87da2) --- source4/lib/ldb/tests/schema-tests/schema.ldif | 9 ++++++--- source4/lib/ldb/tests/test-attribs.ldif | 3 ++- source4/lib/ldb/tests/test-generic.sh | 3 +++ source4/lib/ldb/tests/test-index.ldif | 3 ++- source4/lib/ldb/tests/test-wrong_attributes.ldif | 3 +++ 5 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 source4/lib/ldb/tests/test-wrong_attributes.ldif (limited to 'source4/lib/ldb/tests') diff --git a/source4/lib/ldb/tests/schema-tests/schema.ldif b/source4/lib/ldb/tests/schema-tests/schema.ldif index 651fdac41f..59757d22a9 100644 --- a/source4/lib/ldb/tests/schema-tests/schema.ldif +++ b/source4/lib/ldb/tests/schema-tests/schema.ldif @@ -12,9 +12,12 @@ dn: @ATTRIBUTES realm: CASE_INSENSITIVE userPrincipalName: CASE_INSENSITIVE servicePrincipalName: CASE_INSENSITIVE -name: CASE_INSENSITIVE WILDCARD -dn: CASE_INSENSITIVE WILDCARD -sAMAccountName: CASE_INSENSITIVE WILDCARD +name: CASE_INSENSITIVE +name: WILDCARD +dn: CASE_INSENSITIVE +dn: WILDCARD +sAMAccountName: CASE_INSENSITIVE +sAMAccountName: WILDCARD objectClass: CASE_INSENSITIVE unicodePwd: HIDDEN ntPwdHash: HIDDEN diff --git a/source4/lib/ldb/tests/test-attribs.ldif b/source4/lib/ldb/tests/test-attribs.ldif index 4bfb1ebd65..e6fe1dcf5a 100644 --- a/source4/lib/ldb/tests/test-attribs.ldif +++ b/source4/lib/ldb/tests/test-attribs.ldif @@ -1,5 +1,6 @@ dn: @ATTRIBUTES -uid: CASE_INSENSITIVE WILDCARD +uid: CASE_INSENSITIVE +uid: WILDCARD cn: CASE_INSENSITIVE ou: CASE_INSENSITIVE dn: CASE_INSENSITIVE diff --git a/source4/lib/ldb/tests/test-generic.sh b/source4/lib/ldb/tests/test-generic.sh index 2b2ab2e78a..78fed1c12b 100755 --- a/source4/lib/ldb/tests/test-generic.sh +++ b/source4/lib/ldb/tests/test-generic.sh @@ -25,6 +25,9 @@ time $VALGRIND bin/ldbtest -r 1000 -s 10 || exit 1 echo "Adding index" $VALGRIND bin/ldbadd tests/test-index.ldif || exit 1 +echo "Adding attributes" +$VALGRIND bin/ldbadd tests/test-wrong_attributes.ldif || exit 1 + echo "testing indexed search" $VALGRIND bin/ldbsearch '(uid=uham)' || exit 1 $VALGRIND bin/ldbsearch '(&(objectclass=person)(objectclass=person)(objectclass=top))' || exit 1 diff --git a/source4/lib/ldb/tests/test-index.ldif b/source4/lib/ldb/tests/test-index.ldif index 24ac408764..7ba0106394 100644 --- a/source4/lib/ldb/tests/test-index.ldif +++ b/source4/lib/ldb/tests/test-index.ldif @@ -3,7 +3,8 @@ dn: @INDEXLIST @IDXATTR: objectclass dn: @ATTRIBUTES -uid: CASE_INSENSITIVE WILDCARD +uid: CASE_INSENSITIVE +uid: WILDCARD dn: @SUBCLASSES top: person diff --git a/source4/lib/ldb/tests/test-wrong_attributes.ldif b/source4/lib/ldb/tests/test-wrong_attributes.ldif new file mode 100644 index 0000000000..27f45f0e56 --- /dev/null +++ b/source4/lib/ldb/tests/test-wrong_attributes.ldif @@ -0,0 +1,3 @@ +dn: @ATTRIBUTES +uid: CASE_INTENSIVE + -- cgit