if( sc == NULL ) {
snprintf( textbuf, textlen,
"unrecognized structuralObjectClass '%s'",
- aoc->a_vals[0].bv_val );
+ asc->a_vals[0].bv_val );
#ifdef NEW_LOGGING
LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
if( sc->soc_kind != LDAP_SCHEMA_STRUCTURAL ) {
snprintf( textbuf, textlen,
"structuralObjectClass '%s' is not STRUCTURAL",
- aoc->a_vals[0].bv_val );
+ asc->a_vals[0].bv_val );
#ifdef NEW_LOGGING
LDAP_LOG(( "schema", LDAP_LEVEL_INFO,
assert( aoc->a_vals != NULL );
assert( aoc->a_vals[0].bv_val != NULL );
- rc = structural_class( aoc->a_vals, &nsc, text, textbuf, textlen );
+ rc = structural_class( aoc->a_vals, &nsc, &oc, text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
return rc;
} else if ( nsc.bv_len == 0 ) {
*text = textbuf;
- oc = oc_bvfind( &nsc );
if ( oc == NULL ) {
snprintf( textbuf, textlen,
"unrecognized objectClass '%s'",
- aoc->a_vals[i].bv_val );
+ aoc->a_vals[0].bv_val );
return LDAP_OBJECT_CLASS_VIOLATION;
} else if ( sc != oc ) {
int structural_class(
BVarray ocs,
struct berval *scbv,
+ ObjectClass **scp,
const char **text,
char *textbuf, size_t textlen )
{
}
}
+ if( scp )
+ *scp = sc;
+
if( sc == NULL ) {
*text = "no structural object classes provided";
return LDAP_OBJECT_CLASS_VIOLATION;
return LDAP_OBJECT_CLASS_VIOLATION;
}
- return structural_class( ocmod->sml_bvalues, sc,
+ return structural_class( ocmod->sml_bvalues, sc, NULL,
text, textbuf, textlen );
}
if( sc == NULL ) {
struct berval vals[2];
- int ret = structural_class(
- oc->a_vals, vals, &text, textbuf, textlen );
+ int ret = structural_class( oc->a_vals, vals,
+ NULL, &text, textbuf, textlen );
if( vals[0].bv_len == 0 ) {
fprintf( stderr, "%s: dn=\"%s\" (line=%d): %s\n",