]> git.sur5r.net Git - openldap/commitdiff
For object classes in attribute lists, use '+' (or '-') to indicate
authorKurt Zeilenga <kurt@openldap.org>
Mon, 16 Sep 2002 20:48:08 +0000 (20:48 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 16 Sep 2002 20:48:08 +0000 (20:48 +0000)
name is an objectClass.

servers/slapd/ad.c
tests/scripts/test000-rootdse

index 360da3ca94fe61d7b21ebc8fb53bc16d36517357..89cf5ab1eac9682fcc67050e9539fb9024e7e5e1 100644 (file)
@@ -444,8 +444,18 @@ int ad_inlist(
                 * if so, return attributes which the class requires/allows
                 */
                oc = attrs->an_oc;
-               if( oc == NULL ) {
-                       oc = oc_bvfind( &attrs->an_name );
+               if( oc == NULL && attrs->an_name.bv_val ) {
+                       switch( attrs->an_name.bv_val[0] ) {
+                               case '+':
+                               case '-': {
+                                       struct berval ocname;
+                                       ocname.bv_len = attrs->an_name.bv_len - 1;
+                                       ocname.bv_val = &attrs->an_name.bv_val[1];
+                                       oc = oc_bvfind( &ocname );
+                               } break;
+                               default:
+                                       oc = oc_bvfind( &attrs->an_name );
+                       }
                        attrs->an_oc = oc;
                }
                if( oc != NULL ) {
index 1042459e9899364359517886ff0c5d09d60d6e6c..be5c48e257f66229b0001222895443004587b46c 100755 (executable)
@@ -39,7 +39,7 @@ fi
 
 echo "Using ldapsearch to retrieve the root DSE..."
 for i in 0 1 2 3 4 5; do
-       $LDAPSEARCH -b "" -s base -h $LOCALHOST -p $PORT 'extensibleObject' > $SEARCHOUT 2>&1
+       $LDAPSEARCH -b "" -s base -h $LOCALHOST -p $PORT '+extensibleObject' > $SEARCHOUT 2>&1
        RC=$?
        if test $RC = 0 ; then
                break
@@ -50,7 +50,7 @@ done
 
 if test $RC = 0 -a $MONITORDB = yes ; then
        echo "Using ldapsearch to retrieve the cn=Monitor..."
-       $LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT 'extensibleObject' >> $SEARCHOUT 2>&1
+       $LDAPSEARCH -b "cn=Monitor" -s base -h $LOCALHOST -p $PORT -- '-extensibleObject' >> $SEARCHOUT 2>&1
        RC=$?
 fi