goto done;
}
+ /* make sure RDN is present in attrs */
+ if ( !is_entry_glue ( op->ora_e )) {
+ rs->sr_err = entry_naming_check( op->ora_e, get_relax( op ), 1, &rs->sr_text, textbuf, textlen );
+ if ( rs->sr_err != LDAP_SUCCESS ) {
+ send_ldap_result( op, rs );
+ goto done;
+ }
+ }
+
freevals = 0;
oex = op->o_tmpalloc( sizeof(OpExtraDB), op->o_tmpmemctx );
oex->oe.oe_key = (void *)do_add;
const char** text,
char *textbuf, size_t textlen );
+LDAP_SLAPD_F( int ) entry_naming_check(
+ Entry *e,
+ int manage,
+ int add_naming,
+ const char** text,
+ char *textbuf, size_t textlen );
+
LDAP_SLAPD_F( int ) mods_structural_class(
Modifications *mods,
struct berval *oc,
ObjectClass *oc,
struct berval *ocname );
-static int entry_naming_check(
- Entry *e,
- int manage,
- int add_naming,
- const char** text,
- char *textbuf, size_t textlen );
/*
* entry_schema_check - check that entry e conforms to the schema required
* by its object class(es).
}
/* naming check */
- if ( !is_entry_glue ( e ) ) {
- rc = entry_naming_check( e, manage, add, text, textbuf, textlen );
+ if ( !is_entry_glue ( e ) && !add ) { /* add already did this */
+ rc = entry_naming_check( e, manage, 0, text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
goto done;
}
}
-static int
+int
entry_naming_check(
Entry *e,
int manage,
int rc = entry_schema_check( op, e, manage, 1, NULL,
text, textbuf, textlen );
+ if( rc == LDAP_SUCCESS )
+ rc = entry_naming_check( e, manage, 1, text, textbuf, textlen );
+
if( rc != LDAP_SUCCESS ) {
fprintf( stderr, "%s: dn=\"%s\" (line=%d): (%d) %s\n",
progname, e->e_dn, lineno, rc, *text );