]> git.sur5r.net Git - openldap/commitdiff
SLAPD_SCHEMA_NOT_COMPAT: working cn=schema
authorKurt Zeilenga <kurt@openldap.org>
Mon, 15 May 2000 23:36:37 +0000 (23:36 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 15 May 2000 23:36:37 +0000 (23:36 +0000)
12 files changed:
servers/slapd/acl.c
servers/slapd/at.c
servers/slapd/filter.c
servers/slapd/modify.c
servers/slapd/mr.c
servers/slapd/oc.c
servers/slapd/result.c
servers/slapd/schema.c
servers/slapd/schema_check.c
servers/slapd/schema_init.c
servers/slapd/search.c
servers/slapd/syntax.c

index e587ca7a750afefb0fc7a0989fb1671a966c0369..d44f218676277dc8f8b0a3ac8c2cc866eb92ff0c 100644 (file)
@@ -984,7 +984,7 @@ aci_group_member (
        char *grpoc;
        char *grpat;
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-       AttributeDescription *grpad;
+       AttributeDescription *grpad = NULL;
        char *text;
 #else
        char *grpad;
@@ -1133,7 +1133,7 @@ aci_mask(
                Attribute *at;
                char *dnattr = aci_bvstrdup(&sdn);
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-               AttributeDescription *dnad;
+               AttributeDescription *dnad = NULL;
                char *text;
                rc = slap_str2ad( dnattr, &dnad, &text );
                ch_free( dnattr );
index 9a7872db7a7241182d2e373d2dd5ef79f7e6ac84..e877c79f937eb96b7bfa356f3decc8ba97e43d4d 100644 (file)
@@ -554,20 +554,25 @@ at_schema_info( Entry *e )
        struct berval   *vals[2];
        AttributeType   *at;
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeDescription *ad_attributeTypes = slap_schema.si_ad_attributeTypes;
+#else
+       char *ad_attributeTypes = "attributeTypes";
+#endif
+
        vals[0] = &val;
        vals[1] = NULL;
 
        for ( at = attr_list; at; at = at->sat_next ) {
                val.bv_val = ldap_attributetype2str( &at->sat_atype );
-               if ( val.bv_val ) {
-                       val.bv_len = strlen( val.bv_val );
-                       Debug( LDAP_DEBUG_TRACE, "Merging at [%ld] %s\n",
-                              (long) val.bv_len, val.bv_val, 0 );
-                       attr_merge( e, "attributeTypes", vals );
-                       ldap_memfree( val.bv_val );
-               } else {
+               if ( val.bv_val == NULL ) {
                        return -1;
                }
+               val.bv_len = strlen( val.bv_val );
+               Debug( LDAP_DEBUG_TRACE, "Merging at [%ld] %s\n",
+                      (long) val.bv_len, val.bv_val, 0 );
+               attr_merge( e, ad_attributeTypes, vals );
+               ldap_memfree( val.bv_val );
        }
        return 0;
 }
index 1278915e020c7f786525ce63f6de30303ff5b995..ccaac17f05ac58e90d6698c2d404184b49c25db9 100644 (file)
@@ -39,7 +39,7 @@ get_filter(
        ber_len_t       len;
        int             err;
        Filter          *f;
-       char            *ftmp;
+       char            *ftmp = NULL;
 
        Debug( LDAP_DEBUG_FILTER, "begin get_filter\n", 0, 0, 0 );
 
@@ -157,7 +157,6 @@ get_filter(
                }
 
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-
                *fstr = ch_malloc( sizeof("(<=)")
                        + f->f_av_desc->ad_cname->bv_len
                        + f->f_av_value->bv_len );
@@ -205,6 +204,7 @@ get_filter(
                        + f->f_desc->ad_cname->bv_len );
                sprintf( *fstr, "(%s=*)",
                        f->f_desc->ad_cname->bv_val );
+
 #else
                f->f_type = type.bv_val;
                err = LDAP_SUCCESS;
@@ -247,10 +247,10 @@ get_filter(
                if ( err != LDAP_SUCCESS ) {
                        break;
                }
-               if (ftmp == NULL) ftmp = ch_strdup("");
-               *fstr = ch_malloc( 4 + strlen( ftmp ) );
-               sprintf( *fstr, "(&%s)", ftmp );
-               free( ftmp );
+               *fstr = ch_malloc( sizeof("(&)")
+                       + ( ftmp == NULL ? 0 : strlen( ftmp ) ) );
+               sprintf( *fstr, "(&%s)",
+                       ftmp == NULL ? "" : ftmp );
                break;
 
        case LDAP_FILTER_OR:
@@ -259,10 +259,10 @@ get_filter(
                if ( err != LDAP_SUCCESS ) {
                        break;
                }
-               if (ftmp == NULL) ftmp = ch_strdup("");
-               *fstr = ch_malloc( 4 + strlen( ftmp ) );
-               sprintf( *fstr, "(|%s)", ftmp );
-               free( ftmp );
+               *fstr = ch_malloc( sizeof("(!)")
+                       + ( ftmp == NULL ? 0 : strlen( ftmp ) ) );
+               sprintf( *fstr, "(|%s)",
+                       ftmp == NULL ? "" : ftmp );
                break;
 
        case LDAP_FILTER_NOT:
@@ -272,25 +272,27 @@ get_filter(
                if ( err != LDAP_SUCCESS ) {
                        break;
                }
-               if (ftmp == NULL) ftmp = ch_strdup("");
-               *fstr = ch_malloc( 4 + strlen( ftmp ) );
-               sprintf( *fstr, "(!%s)", ftmp );
-               free( ftmp );
+               *fstr = ch_malloc( sizeof("(!)")
+                       + ( ftmp == NULL ? 0 : strlen( ftmp ) ) );
+               sprintf( *fstr, "(!%s)",
+                       ftmp == NULL ? "" : ftmp );
                break;
 
        case LDAP_FILTER_EXT:
                /* not yet implemented */
                Debug( LDAP_DEBUG_ANY, "extensible match not yet implemented.\n",
                       f->f_choice, 0, 0 );
-               err = LDAP_PROTOCOL_ERROR;
-               *text = "extensible match not yet implemented";
+               f->f_choice = SLAPD_FILTER_COMPUTED;
+               f->f_result = SLAPD_COMPARE_UNDEFINED;
+               *fstr = ch_strdup( "(extended)" );
                break;
 
        default:
                Debug( LDAP_DEBUG_ANY, "get_filter: unknown filter type=%lu\n",
                       f->f_choice, 0, 0 );
-               err = LDAP_PROTOCOL_ERROR;
-               *text = "unknown filter type";
+               f->f_choice = SLAPD_FILTER_COMPUTED;
+               f->f_result = SLAPD_COMPARE_UNDEFINED;
+               *fstr = ch_strdup( "(undefined)" );
                break;
        }
 
@@ -303,6 +305,8 @@ get_filter(
                *filt = f;
        }
 
+       free( ftmp );
+
        Debug( LDAP_DEBUG_FILTER, "end get_filter %d\n", err, 0, 0 );
        return( err );
 }
@@ -599,7 +603,8 @@ filter_print( Filter *f )
                        f->f_av_desc->ad_cname->bv_val,
                    f->f_av_value->bv_val );
 #else
-               fprintf( stderr, "(%s=%s)", f->f_ava.ava_type,
+               fprintf( stderr, "(%s=%s)",
+                       f->f_ava.ava_type,
                    f->f_ava.ava_value.bv_val );
 #endif
                break;
@@ -610,7 +615,8 @@ filter_print( Filter *f )
                        f->f_av_desc->ad_cname->bv_val,
                    f->f_av_value->bv_val );
 #else
-               fprintf( stderr, "(%s>=%s)", f->f_ava.ava_type,
+               fprintf( stderr, "(%s>=%s)",
+                       f->f_ava.ava_type,
                    f->f_ava.ava_value.bv_val );
 #endif
                break;
@@ -621,7 +627,8 @@ filter_print( Filter *f )
                        f->f_ava->aa_desc->ad_cname->bv_val,
                    f->f_ava->aa_value->bv_val );
 #else
-               fprintf( stderr, "(%s<=%s)", f->f_ava.ava_type,
+               fprintf( stderr, "(%s<=%s)",
+                       f->f_ava.ava_type,
                    f->f_ava.ava_value.bv_val );
 #endif
                break;
@@ -632,7 +639,8 @@ filter_print( Filter *f )
                        f->f_ava->aa_desc->ad_cname->bv_val,
                    f->f_ava->aa_value->bv_val );
 #else
-               fprintf( stderr, "(%s~=%s)", f->f_ava.ava_type,
+               fprintf( stderr, "(%s~=%s)",
+                       f->f_ava.ava_type,
                    f->f_ava.ava_value.bv_val );
 #endif
                break;
@@ -642,18 +650,22 @@ filter_print( Filter *f )
                fprintf( stderr, "(%s=" /*)*/,
                        f->f_sub_desc->ad_cname->bv_val );
 #else
-               fprintf( stderr, "(%s=" /*)*/, f->f_sub_type );
+               fprintf( stderr, "(%s=" /*)*/,
+                       f->f_sub_type );
 #endif
                if ( f->f_sub_initial != NULL ) {
-                       fprintf( stderr, "%s", f->f_sub_initial->bv_val );
+                       fprintf( stderr, "%s",
+                               f->f_sub_initial->bv_val );
                }
                if ( f->f_sub_any != NULL ) {
                        for ( i = 0; f->f_sub_any[i] != NULL; i++ ) {
-                               fprintf( stderr, "*%s", f->f_sub_any[i]->bv_val );
+                               fprintf( stderr, "*%s",
+                                       f->f_sub_any[i]->bv_val );
                        }
                }
                if ( f->f_sub_final != NULL ) {
-                       fprintf( stderr, "*%s", f->f_sub_final->bv_val );
+                       fprintf( stderr,
+                               "*%s", f->f_sub_final->bv_val );
                }
                fprintf( stderr, /*(*/ ")" );
                break;
@@ -663,7 +675,8 @@ filter_print( Filter *f )
                fprintf( stderr, "(%s=*)",
                        f->f_desc->ad_cname->bv_val );
 #else
-               fprintf( stderr, "(%s=*)", f->f_type );
+               fprintf( stderr, "(%s=*)",
+                       f->f_type );
 #endif
                break;
 
@@ -680,7 +693,7 @@ filter_print( Filter *f )
                break;
 
        case SLAPD_FILTER_COMPUTED:
-               fprintf( stderr, "(%s)",
+               fprintf( stderr, "(?=%s)",
                        f->f_result == LDAP_COMPARE_FALSE ? "false" :
                        f->f_result == LDAP_COMPARE_TRUE ? "true" :
                        f->f_result == SLAPD_COMPARE_UNDEFINED ? "undefined" :
@@ -688,7 +701,7 @@ filter_print( Filter *f )
                break;
 
        default:
-               fprintf( stderr, "(unknown filter %lu)", f->f_choice );
+               fprintf( stderr, "(unknown-filter=%lu)", f->f_choice );
                break;
        }
 }
index c5f7ca98f770ca0f1d133024b27fbb20c4a5e3c4..181ccd8150886c3fd2bfe646159cd90e83395f86 100644 (file)
@@ -298,7 +298,7 @@ int slap_modlist2mods(
 
        for( ; ml != NULL; ml = ml->ml_next ) {
                Modifications *mod;
-               AttributeDescription *ad;
+               AttributeDescription *ad = NULL;
 
                mod = (Modifications *)
                        ch_calloc( 1, sizeof(Modifications) );
@@ -384,7 +384,6 @@ int slap_mods_opattrs(
        char timebuf[22];
        struct tm *ltm;
        Modifications *mod;
-       AttributeDescription *ad;
 
        int mop = op->o_tag == LDAP_REQ_ADD
                ? LDAP_MOD_ADD : LDAP_MOD_REPLACE;
@@ -405,49 +404,19 @@ int slap_mods_opattrs(
        }
 
        if( op->o_tag == LDAP_REQ_ADD ) {
-               rc = slap_str2ad( "creatorsName", &ad, text );
-               if( rc == LDAP_SUCCESS ) {
-                       mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
-                       mod->sml_op = mop;
-                       mod->sml_desc = ad;
-                       mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
-                       mod->sml_bvalues[0] = ber_bvdup( &name );
-                       mod->sml_bvalues[1] = NULL;
-
-                       *modtail = mod;
-                       modtail = &mod->sml_next;
-               }
-
-               rc = slap_str2ad( "createTimeStamp", &ad, text );
-               if( rc == LDAP_SUCCESS ) {
-                       mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
-                       mod->sml_op = mop;
-                       mod->sml_desc = ad;
-                       mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
-                       mod->sml_bvalues[0] = ber_bvdup( &timestamp );
-                       mod->sml_bvalues[1] = NULL;
-                       *modtail = mod;
-                       modtail = &mod->sml_next;
-               }
-       }
-
-       rc = slap_str2ad( "modifiersName", &ad, text );
-       if( rc == LDAP_SUCCESS ) {
                mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
                mod->sml_op = mop;
-               mod->sml_desc = ad;
+               mod->sml_desc = slap_schema.si_ad_creatorsName;
                mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
                mod->sml_bvalues[0] = ber_bvdup( &name );
                mod->sml_bvalues[1] = NULL;
+
                *modtail = mod;
                modtail = &mod->sml_next;
-       }
 
-       rc = slap_str2ad( "modifyTimeStamp", &ad, text );
-       if( rc == LDAP_SUCCESS ) {
                mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
                mod->sml_op = mop;
-               mod->sml_desc = ad;
+               mod->sml_desc = slap_schema.si_ad_createTimestamp;
                mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
                mod->sml_bvalues[0] = ber_bvdup( &timestamp );
                mod->sml_bvalues[1] = NULL;
@@ -455,6 +424,24 @@ int slap_mods_opattrs(
                modtail = &mod->sml_next;
        }
 
+       mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
+       mod->sml_op = mop;
+       mod->sml_desc = slap_schema.si_ad_modifiersName;
+       mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
+       mod->sml_bvalues[0] = ber_bvdup( &name );
+       mod->sml_bvalues[1] = NULL;
+       *modtail = mod;
+       modtail = &mod->sml_next;
+
+       mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
+       mod->sml_op = mop;
+       mod->sml_desc = slap_schema.si_ad_modifyTimestamp;
+       mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
+       mod->sml_bvalues[0] = ber_bvdup( &timestamp );
+       mod->sml_bvalues[1] = NULL;
+       *modtail = mod;
+       modtail = &mod->sml_next;
+
        return LDAP_SUCCESS;
 }
 
index fd843f6fb5f804946a1947f26919dacb039493e1..6f715ad2dd43df4312387c52eabc6932cb931575 100644 (file)
@@ -194,20 +194,27 @@ int mr_schema_info( Entry *e )
        struct berval   *vals[2];
        MatchingRule    *mr;
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeDescription *ad_matchingRules = slap_schema.si_ad_matchingRules;
+#else
+       char *ad_matchingRules = "matchingRules";
+#endif
+
        vals[0] = &val;
        vals[1] = NULL;
 
        for ( mr = mr_list; mr; mr = mr->smr_next ) {
                val.bv_val = ldap_matchingrule2str( &mr->smr_mrule );
-               if ( val.bv_val ) {
-                       val.bv_len = strlen( val.bv_val );
-                       Debug( LDAP_DEBUG_TRACE, "Merging mr [%ld] %s\n",
-                              (long) val.bv_len, val.bv_val, 0 );
-                       attr_merge( e, "matchingRules", vals );
-                       ldap_memfree( val.bv_val );
-               } else {
+
+               if ( val.bv_val == NULL ) {
                        return -1;
                }
+
+               val.bv_len = strlen( val.bv_val );
+               Debug( LDAP_DEBUG_TRACE, "Merging mr [%ld] %s\n",
+              (long) val.bv_len, val.bv_val, 0 );
+               attr_merge( e, ad_matchingRules, vals );
+               ldap_memfree( val.bv_val );
        }
        return 0;
 }
index d8e31524c9228afc24d142597c30798976d06de3..513ba903e374b8c8ef6f002354dad304cfb1def2 100644 (file)
@@ -23,7 +23,7 @@ int is_entry_objectclass(
        Attribute *attr;
        struct berval bv;
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-       static AttributeDescription *objectClass = NULL;
+       AttributeDescription *objectClass = slap_schema.si_ad_objectClass;
 #else
        static const char *objectClass = "objectclass";
 #endif
@@ -440,20 +440,25 @@ oc_schema_info( Entry *e )
        struct berval   *vals[2];
        ObjectClass     *oc;
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeDescription *ad_objectClasses = slap_schema.si_ad_objectClasses;
+#else
+       char *ad_objectClasses = "objectClasses";
+#endif
+
        vals[0] = &val;
        vals[1] = NULL;
 
        for ( oc = oc_list; oc; oc = oc->soc_next ) {
                val.bv_val = ldap_objectclass2str( &oc->soc_oclass );
-               if ( val.bv_val ) {
-                       val.bv_len = strlen( val.bv_val );
-                       Debug( LDAP_DEBUG_TRACE, "Merging oc [%ld] %s\n",
-                              (long) val.bv_len, val.bv_val, 0 );
-                       attr_merge( e, "objectClasses", vals );
-                       ldap_memfree( val.bv_val );
-               } else {
+               if ( val.bv_val == NULL ) {
                        return -1;
                }
+               val.bv_len = strlen( val.bv_val );
+               Debug( LDAP_DEBUG_TRACE, "Merging oc [%ld] %s\n",
+              (long) val.bv_len, val.bv_val, 0 );
+               attr_merge( e, ad_objectClasses, vals );
+               ldap_memfree( val.bv_val );
        }
        return 0;
 }
index e143286824f27a71790a30c5d23e24aa1b1e6fdf..816e031dfe7fa94264c993983506f122404ee253 100644 (file)
@@ -129,7 +129,7 @@ struct berval **get_entry_referrals(
        unsigned i, j;
 
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-       static AttributeDescription *ref = NULL;
+       AttributeDescription *ref = slap_schema.si_ad_ref;
 #else
        static const char *ref = "ref";
 #endif
@@ -901,8 +901,8 @@ send_search_reference(
        int bytes;
 
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-       static AttributeDescription *ref = NULL;
-       static AttributeDescription *entry = NULL;
+       AttributeDescription *ref = slap_schema.si_ad_ref;
+       AttributeDescription *entry = slap_schema.si_ad_entry;
 #else
        static const char *ref = "ref";
        static const char *entry = "entry";
index e82b8cc6002a3eb6a27d3f444577b7507b95ce34..4dc42d6617840260c9b4440212fd25fa7cb9e810 100644 (file)
 void
 schema_info( Connection *conn, Operation *op, char **attrs, int attrsonly )
 {
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass;
+#else
+       char *ad_objectClass = "objectClass";
+#endif
+
        Entry           *e;
        struct berval   val;
        struct berval   *vals[2];
@@ -37,17 +43,59 @@ schema_info( Connection *conn, Operation *op, char **attrs, int attrsonly )
        (void) dn_normalize( e->e_ndn );
        e->e_private = NULL;
 
+       val.bv_val = "top";
+       val.bv_len = sizeof("top")-1;
+       attr_merge( e, ad_objectClass, vals );
+
+       val.bv_val = "LDAPsubentry";
+       val.bv_len = sizeof("LDAPsubentry")-1;
+       attr_merge( e, ad_objectClass, vals );
+
+       val.bv_val = "subschema";
+       val.bv_len = sizeof("subschema")-1;
+       attr_merge( e, ad_objectClass, vals );
+
+       val.bv_val = "extensibleObject";
+       val.bv_len = sizeof("extensibleObject")-1;
+       attr_merge( e, ad_objectClass, vals );
+
        {
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               int rc;
+               char *text;
+               AttributeDescription *desc = NULL;
+#else
+               char *desc;
+#endif
                char *rdn = ch_strdup( SLAPD_SCHEMA_DN );
                val.bv_val = strchr( rdn, '=' );
 
-               if( val.bv_val != NULL ) {
-                       *val.bv_val = '\0';
-                       val.bv_len = strlen( ++val.bv_val );
+               if( val.bv_val == NULL ) {
+                       send_ldap_result( conn, op, LDAP_OTHER,
+                               NULL, "improperly configured subschema subentry",
+                               NULL, NULL );
+                       free( rdn );
+                       return;
+               }
 
-                       attr_merge( e, rdn, vals );
+               *val.bv_val = '\0';
+               val.bv_len = strlen( ++val.bv_val );
+
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               rc = slap_str2ad( rdn, &desc, &text );
+
+               if( rc != LDAP_SUCCESS ) {
+                       send_ldap_result( conn, op, LDAP_OTHER,
+                               NULL, "improperly configured subschema subentry",
+                               NULL, NULL );
+                       free( rdn );
+                       return;
                }
+#else
+               desc = rdn;
+#endif
 
+               attr_merge( e, desc, vals );
                free( rdn );
        }
 
@@ -63,22 +111,6 @@ schema_info( Connection *conn, Operation *op, char **attrs, int attrsonly )
                return;
        }
        
-       val.bv_val = "top";
-       val.bv_len = sizeof("top")-1;
-       attr_merge( e, "objectClass", vals );
-
-       val.bv_val = "LDAPsubentry";
-       val.bv_len = sizeof("LDAPsubentry")-1;
-       attr_merge( e, "objectClass", vals );
-
-       val.bv_val = "subschema";
-       val.bv_len = sizeof("subschema")-1;
-       attr_merge( e, "objectClass", vals );
-
-       val.bv_val = "extensibleObject";
-       val.bv_len = sizeof("extensibleObject")-1;
-       attr_merge( e, "objectClass", vals );
-
        send_search_entry( &backends[0], conn, op,
                e, attrs, attrsonly, NULL );
        send_search_result( conn, op, LDAP_SUCCESS,
index 26dc3012c7b954ece40def01f65bad201fe172f9..351b9c416fe64e31cb7c7dfa67cb512b2283281d 100644 (file)
@@ -41,15 +41,15 @@ entry_schema_check(
        int             i;
        int             ret;
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-       static AttributeDescription *objectClass = NULL;
+       AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass;
 #else
-       static const char *objectClass = "objectclass";
+       static const char *ac_objectClass = "objectclass";
 #endif
 
        if( !global_schemacheck ) return LDAP_SUCCESS;
 
        /* find the object class attribute - could error out here */
-       if ( (aoc = attr_find( e->e_attrs, objectClass )) == NULL ) {
+       if ( (aoc = attr_find( e->e_attrs, ad_objectClass )) == NULL ) {
                Debug( LDAP_DEBUG_ANY, "No object class for entry (%s)\n",
                    e->e_dn, 0, 0 );
 
index 349d17aea754620d716a6e2377177fde3e7e4ec1..54fb340e57d824f31a28b4a39322532e2e9372c5 100644 (file)
@@ -650,6 +650,15 @@ struct slap_schema_ad_map {
        { "supportedSASLMechanisms",
                offsetof(struct slap_internal_schema, si_ad_supportedSASLMechanisms) },
 
+       { "attributeTypes",
+               offsetof(struct slap_internal_schema, si_ad_attributeTypes) },
+       { "ldapSyntaxes",
+               offsetof(struct slap_internal_schema, si_ad_ldapSyntaxes) },
+       { "matchingRules",
+               offsetof(struct slap_internal_schema, si_ad_matchingRules) },
+       { "objectClasses",
+               offsetof(struct slap_internal_schema, si_ad_objectClasses) },
+
        { "ref",
                offsetof(struct slap_internal_schema, si_ad_ref) },
 
index 7037d8d55b08f34c24897f13cddc2bbf9ec11c05..22082200fc97430fab52865be46be7524ba86ed9 100644 (file)
@@ -161,27 +161,27 @@ do_search(
 
        if ( scope == LDAP_SCOPE_BASE ) {
 #if defined( SLAPD_MONITOR_DN )
-               if ( strcmp( nbase, SLAPD_MONITOR_DN ) == 0 ) {
+               if ( strcasecmp( nbase, SLAPD_MONITOR_DN ) == 0 ) {
                        monitor_info( conn, op, attrs, attrsonly );
                        goto return_results;
                }
 #endif
 
 #if defined( SLAPD_CONFIG_DN )
-               if ( strcmp( nbase, SLAPD_CONFIG_DN ) == 0 ) {
+               if ( strcasecmp( nbase, SLAPD_CONFIG_DN ) == 0 ) {
                        config_info( conn, op, attrs, attrsonly );
                        goto return_results;
                }
 #endif
 
 #if defined( SLAPD_SCHEMA_DN )
-               if ( strcmp( nbase, SLAPD_SCHEMA_DN ) == 0 ) {
+               if ( strcasecmp( nbase, SLAPD_SCHEMA_DN ) == 0 ) {
                        schema_info( conn, op, attrs, attrsonly );
                        goto return_results;
                }
 #endif
 
-               if ( strcmp( nbase, LDAP_ROOT_DSE ) == 0 ) {
+               if ( strcasecmp( nbase, LDAP_ROOT_DSE ) == 0 ) {
                        root_dse_info( conn, op, attrs, attrsonly );
                        goto return_results;
                }
index cdbd656cc973592b30b350df2b2f74d73d7cf9cd..3d151a9a514b83f751900af92c3cd8ab2514d12f 100644 (file)
@@ -161,20 +161,25 @@ syn_schema_info( Entry *e )
        struct berval   *vals[2];
        Syntax          *syn;
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeDescription *ad_ldapSyntaxes = slap_schema.si_ad_ldapSyntaxes;
+#else
+       char *ad_ldapSyntaxes = "ldapSyntaxes";
+#endif
+
        vals[0] = &val;
        vals[1] = NULL;
 
        for ( syn = syn_list; syn; syn = syn->ssyn_next ) {
                val.bv_val = ldap_syntax2str( &syn->ssyn_syn );
-               if ( val.bv_val ) {
-                       val.bv_len = strlen( val.bv_val );
-                       Debug( LDAP_DEBUG_TRACE, "Merging syn [%ld] %s\n",
-                              (long) val.bv_len, val.bv_val, 0 );
-                       attr_merge( e, "ldapSyntaxes", vals );
-                       ldap_memfree( val.bv_val );
-               } else {
+               if ( val.bv_val == NULL ) {
                        return -1;
                }
+               val.bv_len = strlen( val.bv_val );
+               Debug( LDAP_DEBUG_TRACE, "Merging syn [%ld] %s\n",
+              (long) val.bv_len, val.bv_val, 0 );
+               attr_merge( e, ad_ldapSyntaxes, vals );
+               ldap_memfree( val.bv_val );
        }
        return 0;
 }