- Attribute *a, *aoc;
- struct objclass *oc;
- int i;
- int ret = 0;
-
- /* find the object class attribute - could error out here */
- if ( (aoc = attr_find( e->e_attrs, "objectclass" )) == NULL ) {
- Debug( LDAP_DEBUG_ANY, "No object class for entry (%s)\n",
- e->e_dn, 0, 0 );
- return( 0 );
- }
-
- /* check that the entry has required attrs for each oc */
- for ( i = 0; aoc->a_vals[i] != NULL; i++ ) {
- if ( oc_check_required( e, aoc->a_vals[i]->bv_val ) != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "Entry (%s), required attr (%s) missing\n",
- e->e_dn, aoc->a_vals[i]->bv_val, 0 );
- ret = 1;
- }
- }
-
- if ( ret != 0 ) {
- return( ret );
- }
-
- /* check that each attr in the entry is allowed by some oc */
- for ( a = e->e_attrs; a != NULL; a = a->a_next ) {
- if ( oc_check_allowed( a->a_type, aoc->a_vals ) != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "Entry (%s), attr (%s) not allowed\n",
- e->e_dn, a->a_type, 0 );
- ret = 1;
+ AttributeDescription *ad_structuralObjectClass
+ = slap_schema.si_ad_structuralObjectClass;
+ AttributeDescription *ad_objectClass
+ = slap_schema.si_ad_objectClass;
+ AttributeDescription *ad_createTimestamp
+ = slap_schema.si_ad_createTimestamp;
+ AttributeDescription *ad_modifyTimestamp
+ = slap_schema.si_ad_modifyTimestamp;
+
+ Entry *e;
+ struct berval vals[5];
+
+ e = (Entry *) ch_calloc( 1, sizeof(Entry) );
+
+ e->e_attrs = NULL;
+ /* backend-specific schema info should be created by the
+ * backend itself
+ */
+ ber_dupbv( &e->e_name, &global_schemadn );
+ ber_dupbv( &e->e_nname, &global_schemandn );
+ e->e_private = NULL;
+
+ vals[0].bv_val = "subentry";
+ vals[0].bv_len = sizeof("subentry")-1;
+ attr_merge_one( e, ad_structuralObjectClass, vals );
+
+ vals[0].bv_val = "top";
+ vals[0].bv_len = sizeof("top")-1;
+ vals[1].bv_val = "subentry";
+ vals[1].bv_len = sizeof("subentry")-1;
+ vals[2].bv_val = "subschema";
+ vals[2].bv_len = sizeof("subschema")-1;
+ vals[3].bv_val = "extensibleObject";
+ vals[3].bv_len = sizeof("extensibleObject")-1;
+ vals[4].bv_val = NULL;
+ attr_merge( e, ad_objectClass, vals );
+
+ {
+ int rc;
+ AttributeDescription *desc = NULL;
+ struct berval rdn = global_schemadn;
+ vals[0].bv_val = strchr( rdn.bv_val, '=' );
+
+ if( vals[0].bv_val == NULL ) {
+ *text = "improperly configured subschema subentry";
+ return LDAP_OTHER;