+ asc = attr_find( e->e_attrs, ad_structuralObjectClass );
+ if ( asc == NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "schema", LDAP_LEVEL_INFO, "entry_schema_check: "
+ "No structuralObjectClass for entry (%s)\n",
+ e->e_dn ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "No structuralObjectClass for entry (%s)\n",
+ e->e_dn, 0, 0 );
+#endif
+
+ *text = "no structuralObjectClass operational attribute";
+ return LDAP_OBJECT_CLASS_VIOLATION;
+ }
+
+ assert( asc->a_vals != NULL );
+ assert( asc->a_vals[0].bv_val != NULL );
+ assert( asc->a_vals[1].bv_val == NULL );
+
+ sc = oc_bvfind( &asc->a_vals[0] );
+ if( sc == NULL ) {
+ snprintf( textbuf, textlen,
+ "unrecognized structuralObjectClass '%s'",
+ asc->a_vals[0].bv_val );
+
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
+ "entry_schema_check: dn (%s), %s\n",
+ e->e_dn, textbuf ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "entry_check_schema(%s): %s\n",
+ e->e_dn, textbuf, 0 );
+#endif
+
+ return LDAP_OBJECT_CLASS_VIOLATION;
+ }
+
+ if( sc->soc_kind != LDAP_SCHEMA_STRUCTURAL ) {
+ snprintf( textbuf, textlen,
+ "structuralObjectClass '%s' is not STRUCTURAL",
+ asc->a_vals[0].bv_val );
+
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
+ "entry_schema_check: dn (%s), %s\n",
+ e->e_dn, textbuf ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "entry_check_schema(%s): %s\n",
+ e->e_dn, textbuf, 0 );
+#endif
+
+ return LDAP_OBJECT_CLASS_VIOLATION;
+ }
+
+ /* find the object class attribute */
+ aoc = attr_find( e->e_attrs, ad_objectClass );
+ if ( aoc == NULL ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
+ "entry_schema_check: No objectClass for entry (%s).\n"
+ e->e_dn ));
+#else
+ Debug( LDAP_DEBUG_ANY, "No objectClass for entry (%s)\n",