mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Treat unrecognized object classes as an objecdt class violation (per X.511)
This commit is contained in:
parent
6d0479b2a6
commit
2ae02fc19b
1 changed files with 7 additions and 13 deletions
|
|
@ -42,10 +42,8 @@ entry_schema_check(
|
||||||
if ( (aoc = attr_find( e->e_attrs, ad_objectClass )) == NULL ) {
|
if ( (aoc = attr_find( e->e_attrs, ad_objectClass )) == NULL ) {
|
||||||
Debug( LDAP_DEBUG_ANY, "No object class for entry (%s)\n",
|
Debug( LDAP_DEBUG_ANY, "No object class for entry (%s)\n",
|
||||||
e->e_dn, 0, 0 );
|
e->e_dn, 0, 0 );
|
||||||
*text = "no objectclass attribute";
|
*text = "no objectClass attribute";
|
||||||
return oldattrs != NULL
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
||||||
? LDAP_OBJECT_CLASS_VIOLATION
|
|
||||||
: LDAP_NO_OBJECT_CLASS_MODS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = LDAP_SUCCESS;
|
ret = LDAP_SUCCESS;
|
||||||
|
|
@ -54,8 +52,10 @@ entry_schema_check(
|
||||||
for ( i = 0; aoc->a_vals[i] != NULL; i++ ) {
|
for ( i = 0; aoc->a_vals[i] != NULL; i++ ) {
|
||||||
if ( (oc = oc_find( aoc->a_vals[i]->bv_val )) == NULL ) {
|
if ( (oc = oc_find( aoc->a_vals[i]->bv_val )) == NULL ) {
|
||||||
Debug( LDAP_DEBUG_ANY,
|
Debug( LDAP_DEBUG_ANY,
|
||||||
"entry_check_schema(%s): objectclass \"%s\" not defined\n",
|
"entry_check_schema(%s): objectclass \"%s\" not recognized\n",
|
||||||
e->e_dn, aoc->a_vals[i]->bv_val, 0 );
|
e->e_dn, aoc->a_vals[i]->bv_val, 0 );
|
||||||
|
*text = "unrecognized object class";
|
||||||
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
char *s = oc_check_required( e, aoc->a_vals[i] );
|
char *s = oc_check_required( e, aoc->a_vals[i] );
|
||||||
|
|
@ -65,22 +65,16 @@ entry_schema_check(
|
||||||
"Entry (%s), oc \"%s\" requires attr \"%s\"\n",
|
"Entry (%s), oc \"%s\" requires attr \"%s\"\n",
|
||||||
e->e_dn, aoc->a_vals[i]->bv_val, s );
|
e->e_dn, aoc->a_vals[i]->bv_val, s );
|
||||||
*text = "missing required attribute";
|
*text = "missing required attribute";
|
||||||
ret = LDAP_OBJECT_CLASS_VIOLATION;
|
return LDAP_OBJECT_CLASS_VIOLATION;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( oc == slap_schema.si_oc_extensibleObject )
|
if( oc == slap_schema.si_oc_extensibleObject ) {
|
||||||
{
|
|
||||||
extensible=1;
|
extensible=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ret != LDAP_SUCCESS ) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( extensible ) {
|
if( extensible ) {
|
||||||
return LDAP_SUCCESS;
|
return LDAP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue