From: Howard Chu Date: Wed, 2 Jan 2002 23:26:20 +0000 (+0000) Subject: Minor cleanup X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~338 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=013b3a9f3df331a072b53bc6f330f7656035395c;p=openldap Minor cleanup --- diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index ae0ff67101..ee5cf82ad8 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -818,6 +818,7 @@ LDAP_SLAPD_F( int ) oc_check_allowed( LDAP_SLAPD_F( int ) structural_class( BVarray ocs, struct berval *scbv, + ObjectClass **sc, const char **text, char *textbuf, size_t textlen ); diff --git a/servers/slapd/schema_check.c b/servers/slapd/schema_check.c index b72517903a..681e7cc650 100644 --- a/servers/slapd/schema_check.c +++ b/servers/slapd/schema_check.c @@ -104,7 +104,7 @@ entry_schema_check( 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, @@ -122,7 +122,7 @@ entry_schema_check( 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, @@ -156,7 +156,7 @@ entry_schema_check( 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 ) { @@ -165,11 +165,10 @@ entry_schema_check( *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 ) { @@ -448,6 +447,7 @@ int oc_check_allowed( int structural_class( BVarray ocs, struct berval *scbv, + ObjectClass **scp, const char **text, char *textbuf, size_t textlen ) { @@ -518,6 +518,9 @@ int structural_class( } } + if( scp ) + *scp = sc; + if( sc == NULL ) { *text = "no structural object classes provided"; return LDAP_OBJECT_CLASS_VIOLATION; @@ -558,6 +561,6 @@ int mods_structural_class( return LDAP_OBJECT_CLASS_VIOLATION; } - return structural_class( ocmod->sml_bvalues, sc, + return structural_class( ocmod->sml_bvalues, sc, NULL, text, textbuf, textlen ); } diff --git a/servers/slapd/tools/slapadd.c b/servers/slapd/tools/slapadd.c index 3d49531923..41b3a36318 100644 --- a/servers/slapd/tools/slapadd.c +++ b/servers/slapd/tools/slapadd.c @@ -113,8 +113,8 @@ main( int argc, char **argv ) 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",