From: Pierangelo Masarati Date: Wed, 21 Dec 2005 00:08:13 +0000 (+0000) Subject: check "pretty" entryUUID; use a DN with entryUUID as naming attr in filter X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~531 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=92ef3ba79088e03a13a2493ef1ff6edf226568fa;p=openldap check "pretty" entryUUID; use a DN with entryUUID as naming attr in filter --- diff --git a/tests/data/dn.out b/tests/data/dn.out index a517c068b2..346567bc06 100644 --- a/tests/data/dn.out +++ b/tests/data/dn.out @@ -1,3 +1,4 @@ +# Searching database... dn: dc=example,dc=com objectClass: domain objectClass: domainRelatedObject @@ -21,7 +22,7 @@ member: ou=Sales\3B Data\2BAlgorithms,dc=example,dc=net member:: Y249QmVmb3JlDUFmdGVyLGRjPWV4YW1wbGUsZGM9bmV0 member: cn=\23John Smith\20,dc=example,dc=net member:: Y249THXEjWnEhw== -member: testUUID=597ae2f6-16a6-1027-98f4-d28b5365dc14,dc=Example +member: testUUID=597ae2f6-16a6-1027-98f4-abcdefabcdef,dc=Example seeAlso: cn=John Smith\2C III,dc=example,dc=net seeAlso: ou=Sales\3B Data\2BAlgorithms,dc=example,dc=net seeAlso: cn=\23John Smith\20,dc=example,dc=net @@ -41,7 +42,7 @@ description: CN=Before\0dAfter,DC=example,DC=net description: CN=\23John Smith\20,DC=example,DC=net description: CN=\#John Smith\ ,DC=example,DC=net description: CN=Lu\C4\8Di\C4\87 -description: testUUID=597ae2f6-16a6-1027-98f4-d28b5365dc14,DC=Example +description: testUUID=597ae2f6-16a6-1027-98f4-abcdefABCDEF,DC=Example dn: cn=Unescaped Equals,ou=LDAPv3,dc=example,dc=com objectClass: groupOfNames @@ -110,6 +111,7 @@ description: dc=example,dc=com#0'B // malformed UID? description: dc=example,dc=com#'0B // malformed UID? description: dc=example,dc=com '0'B // malformed UID? +# Searching database for DN="OU=Sales+CN=J. Smith,DC=example,DC=net"... dn: cn=Must Succeed,ou=LDAPv3,dc=example,dc=com objectClass: groupOfNames cn: Must Succeed @@ -122,7 +124,7 @@ member: ou=Sales\3B Data\2BAlgorithms,dc=example,dc=net member:: Y249QmVmb3JlDUFmdGVyLGRjPWV4YW1wbGUsZGM9bmV0 member: cn=\23John Smith\20,dc=example,dc=net member:: Y249THXEjWnEhw== -member: testUUID=597ae2f6-16a6-1027-98f4-d28b5365dc14,dc=Example +member: testUUID=597ae2f6-16a6-1027-98f4-abcdefabcdef,dc=Example seeAlso: cn=John Smith\2C III,dc=example,dc=net seeAlso: ou=Sales\3B Data\2BAlgorithms,dc=example,dc=net seeAlso: cn=\23John Smith\20,dc=example,dc=net @@ -142,8 +144,45 @@ description: CN=Before\0dAfter,DC=example,DC=net description: CN=\23John Smith\20,DC=example,DC=net description: CN=\#John Smith\ ,DC=example,DC=net description: CN=Lu\C4\8Di\C4\87 -description: testUUID=597ae2f6-16a6-1027-98f4-d28b5365dc14,dc=Example +description: testUUID=597ae2f6-16a6-1027-98f4-abcdefABCDEF,DC=Example +# Searching database for entryUUID-named DN="testUUID=597ae2f6-16a6-1027-98f4-ABCDEFabcdef,DC=Example"... +dn: cn=Must Succeed,ou=LDAPv3,dc=example,dc=com +objectClass: groupOfNames +cn: Must Succeed +member: cn=Must Succeed,ou=LDAPv3,dc=example,dc=com +member: +member: uid=jsmith,dc=example,dc=net +member: cn=J. Smith+ou=Sales,dc=example,dc=net +member: cn=John Smith\2C III,dc=example,dc=net +member: ou=Sales\3B Data\2BAlgorithms,dc=example,dc=net +member:: Y249QmVmb3JlDUFmdGVyLGRjPWV4YW1wbGUsZGM9bmV0 +member: cn=\23John Smith\20,dc=example,dc=net +member:: Y249THXEjWnEhw== +member: testUUID=597ae2f6-16a6-1027-98f4-abcdefabcdef,dc=Example +seeAlso: cn=John Smith\2C III,dc=example,dc=net +seeAlso: ou=Sales\3B Data\2BAlgorithms,dc=example,dc=net +seeAlso: cn=\23John Smith\20,dc=example,dc=net +description: "member" values contain specific DN forms; +description: "seeAlso" values contain DN forms already defined as "member", +description: but in a different string representation; +description: the following "description" values contain the "member" and +description: "seeAlso" DN string representations used above. +description: "" +description: UID=jsmith,DC=example,DC=net +description: OU=Sales+CN=J. Smith,DC=example,DC=net +description: CN=John Smith\, III,DC=example,DC=net +description: CN=John Smith\2C III,DC=example,DC=net +description: OU=Sales\; Data\+Algorithms,DC=example,DC=net +description: OU=Sales\3B Data\2BAlgorithms,DC=example,DC=net +description: CN=Before\0dAfter,DC=example,DC=net +description: CN=\23John Smith\20,DC=example,DC=net +description: CN=\#John Smith\ ,DC=example,DC=net +description: CN=Lu\C4\8Di\C4\87 +description: testUUID=597ae2f6-16a6-1027-98f4-abcdefABCDEF,DC=Example + +# Searching database for nameAndOptionalUID="dc=example,dc=com"... +# Searching database for nameAndOptionalUID="dc=example,dc=com#'001000'B"... dn: cn=Name and Optional UID,ou=Related Syntaxes,dc=example,dc=com objectClass: groupOfUniqueNames cn: Name and Optional UID @@ -159,6 +198,7 @@ description: #'0010'B // empty "" DN with leading '0's description: dc=example,dc=com#'1000'B // with DN portion description: dc=example,dc=com#'0'B // with DN portion and just one '0' +# Searching database for uniqueMember~="dc=example,dc=com" (approx) ... dn: cn=Name and Optional UID,ou=Related Syntaxes,dc=example,dc=com objectClass: groupOfUniqueNames cn: Name and Optional UID @@ -174,6 +214,7 @@ description: #'0010'B // empty "" DN with leading '0's description: dc=example,dc=com#'1000'B // with DN portion description: dc=example,dc=com#'0'B // with DN portion and just one '0' +# Searching database for uniqueMember~="dc=example,dc=com#'001000'B" (approx) ... dn: cn=Name and Optional UID,ou=Related Syntaxes,dc=example,dc=com objectClass: groupOfUniqueNames cn: Name and Optional UID diff --git a/tests/data/test-dn.ldif b/tests/data/test-dn.ldif index 66730d1e41..412a546a23 100644 --- a/tests/data/test-dn.ldif +++ b/tests/data/test-dn.ldif @@ -24,7 +24,7 @@ member: OU=Sales\; Data\+Algorithms,DC=example,DC=net member: CN=Before\0dAfter,DC=example,DC=net member: CN=\23John Smith\20,DC=example,DC=net member: CN=Lu\C4\8Di\C4\87 -member: testUUID=597ae2f6-16a6-1027-98f4-d28b5365dc14,DC=Example +member: testUUID=597ae2f6-16a6-1027-98f4-abcdefABCDEF,DC=Example # DN forms already defined as "member" in a different string representation seeAlso: CN=John Smith\2C III,DC=example,DC=net seeAlso: OU=Sales\3B Data\2BAlgorithms,DC=example,DC=net @@ -47,7 +47,7 @@ description: CN=Before\0dAfter,DC=example,DC=net description: CN=\23John Smith\20,DC=example,DC=net description: CN=\#John Smith\ ,DC=example,DC=net description: CN=Lu\C4\8Di\C4\87 -description: testUUID=597ae2f6-16a6-1027-98f4-d28b5365dc14,DC=Example +description: testUUID=597ae2f6-16a6-1027-98f4-abcdefABCDEF,DC=Example dn: cn=Should Succeed,ou=LDAPv3,dc=example,dc=com objectClass: groupOfNames diff --git a/tests/scripts/test026-dn b/tests/scripts/test026-dn index 2bbeec105f..fee3c4c982 100755 --- a/tests/scripts/test026-dn +++ b/tests/scripts/test026-dn @@ -51,8 +51,24 @@ echo "Loading database..." $LDAPADD -D "$MANAGERDN" -h $LOCALHOST -p $PORT1 -w $PASSWD -c -f $LDIFDN > \ $TESTOUT 2>&1 +cat /dev/null > $SEARCHOUT + echo "Searching database..." -$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 > $SEARCHOUT 2>&1 +echo "# Searching database..." >> $SEARCHOUT +$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 >> $SEARCHOUT 2>&1 + +RC=$? +if test $RC != 0 ; then + echo "ldapsearch failed ($RC)!" + test $KILLSERVERS != no && kill -HUP $KILLPIDS + exit $RC +fi + +DN="OU=Sales+CN=J. Smith,DC=example,DC=net" +echo "Searching database for DN=\"$DN\"..." +echo "# Searching database for DN=\"$DN\"..." >> $SEARCHOUT +$LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ + "(member=$DN)" >> $SEARCHOUT 2>&1 RC=$? if test $RC != 0 ; then @@ -61,9 +77,12 @@ if test $RC != 0 ; then exit $RC fi -echo "Searching database for DN..." +DN="testUUID=597ae2f6-16a6-1027-98f4-ABCDEFabcdef,DC=Example" +echo "Searching database for entryUUID-named DN=\"$DN\"..." +echo "# Searching database for entryUUID-named DN=\"$DN\"..." >> $SEARCHOUT $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ - "(member=OU=Sales+CN=J. Smith,DC=example,DC=net)" >> $SEARCHOUT 2>&1 + "(member=$DN)" \ + >> $SEARCHOUT 2>&1 RC=$? if test $RC != 0 ; then @@ -72,9 +91,11 @@ if test $RC != 0 ; then exit $RC fi -echo "Searching database for uniqueMember..." +DN="dc=example,dc=com" +echo "Searching database for nameAndOptionalUID=\"$DN\"..." +echo "# Searching database for nameAndOptionalUID=\"$DN\"..." >> $SEARCHOUT $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ - "(uniqueMember=dc=example,dc=com)" >> $SEARCHOUT 2>&1 + "(uniqueMember=$DN)" >> $SEARCHOUT 2>&1 RC=$? if test $RC != 0 ; then @@ -83,9 +104,11 @@ if test $RC != 0 ; then exit $RC fi -echo "Searching database for uniqueMember..." +DN="dc=example,dc=com#'001000'B" +echo "Searching database for nameAndOptionalUID=\"$DN\"..." +echo "# Searching database for nameAndOptionalUID=\"$DN\"..." >> $SEARCHOUT $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ - "(uniqueMember=dc=example,dc=com#'001000'B)" >> $SEARCHOUT 2>&1 + "(uniqueMember=$DN)" >> $SEARCHOUT 2>&1 RC=$? if test $RC != 0 ; then @@ -94,9 +117,11 @@ if test $RC != 0 ; then exit $RC fi -echo "Searching database for uniqueMember (approx) ..." +DN="dc=example,dc=com" +echo "Searching database for uniqueMember~=\"$DN\" (approx) ..." +echo "# Searching database for uniqueMember~=\"$DN\" (approx) ..." >> $SEARCHOUT $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ - "(uniqueMember~=dc=example,dc=com)" >> $SEARCHOUT 2>&1 + "(uniqueMember~=)" >> $SEARCHOUT 2>&1 RC=$? if test $RC != 0 ; then @@ -105,9 +130,11 @@ if test $RC != 0 ; then exit $RC fi -echo "Searching database for uniqueMember (approx) ..." +DN="dc=example,dc=com#'001000'B" +echo "Searching database for uniqueMember~=\"$DN\" (approx) ..." +echo "# Searching database for uniqueMember~=\"$DN\" (approx) ..." >> $SEARCHOUT $LDAPSEARCH -b "$BASEDN" -h $LOCALHOST -p $PORT1 \ - "(uniqueMember~=dc=example,dc=com#'001000'B)" >> $SEARCHOUT 2>&1 + "(uniqueMember~=$DN)" >> $SEARCHOUT 2>&1 RC=$? if test $RC != 0 ; then