static int entry_naming_check(
Entry *e,
+ int manage,
const char** text,
char *textbuf, size_t textlen );
/*
Backend *be,
Entry *e,
Attribute *oldattrs,
+ int manage,
const char** text,
char *textbuf, size_t textlen )
{
const char *type = a->a_desc->ad_cname.bv_val;
/* there should be at least one value */
- assert( a->a_vals );
+ assert( a->a_vals != NULL );
assert( a->a_vals[0].bv_val != NULL );
if( a->a_desc->ad_type->sat_check ) {
}
}
- /* it's a REALLY bad idea to disable schema checks */
- if( !global_schemacheck ) return LDAP_SUCCESS;
-
/* find the structural object class attribute */
asc = attr_find( e->e_attrs, ad_structuralObjectClass );
if ( asc == NULL ) {
return LDAP_OTHER;
}
- if( sc->soc_obsolete ) {
+ if( !manage && sc->soc_obsolete ) {
snprintf( textbuf, textlen,
"structuralObjectClass '%s' is OBSOLETE",
asc->a_vals[0].bv_val );
/* naming check */
if ( !is_entry_objectclass ( e, slap_schema.si_oc_glue, 0 ) ) {
- rc = entry_naming_check( e, text, textbuf, textlen );
+ rc = entry_naming_check( e, manage, text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
return rc;
}
/* check that the entry has required attrs of the content rule */
if( cr ) {
- if( cr->scr_obsolete ) {
+ if( !manage && cr->scr_obsolete ) {
snprintf( textbuf, textlen,
"content rule '%s' is obsolete",
ldap_contentrule2name( &cr->scr_crule ));
return LDAP_OBJECT_CLASS_VIOLATION;
}
- if ( oc->soc_obsolete ) {
+ if ( !manage && oc->soc_obsolete ) {
/* disallow obsolete classes */
snprintf( textbuf, textlen,
"objectClass '%s' is OBSOLETE",
static int
entry_naming_check(
Entry *e,
+ int manage,
const char** text,
char *textbuf, size_t textlen )
{
ber_len_t cnt;
int rc = LDAP_SUCCESS;
+ if ( BER_BVISEMPTY( &e->e_name )) {
+ return LDAP_SUCCESS;
+ }
+
/*
* Get attribute type(s) and attribute value(s) of our RDN
*/
break;
}
- if( desc->ad_type->sat_obsolete ) {
+ if( !manage && desc->ad_type->sat_obsolete ) {
snprintf( textbuf, textlen,
"naming attribute '%s' is obsolete",
ava->la_attr.bv_val );