Skip to content
Snippets Groups Projects
Commit 013b3a9f authored by Howard Chu's avatar Howard Chu
Browse files

Minor cleanup

parent 81d2a0f2
Branches
Tags
No related merge requests found
......@@ -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 );
......
......@@ -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 );
}
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment