mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
Minor cleanup
This commit is contained in:
parent
81d2a0f289
commit
013b3a9f3d
3 changed files with 12 additions and 8 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue