mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-06 23:19:59 -05:00
ITS#7420 move entry_naming_check earlier in Add
Make sure RDN is present in e_attrs before passing entry to overlays
This commit is contained in:
parent
314800db23
commit
f5c96f4469
4 changed files with 22 additions and 9 deletions
|
|
@ -184,6 +184,15 @@ do_add( Operation *op, SlapReply *rs )
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -1799,6 +1799,13 @@ LDAP_SLAPD_F( int ) entry_schema_check(
|
|||
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,
|
||||
|
|
|
|||
|
|
@ -29,12 +29,6 @@ static char * oc_check_required(
|
|||
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).
|
||||
|
|
@ -237,8 +231,8 @@ got_soc:
|
|||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
|
@ -772,7 +766,7 @@ int mods_structural_class(
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
int
|
||||
entry_naming_check(
|
||||
Entry *e,
|
||||
int manage,
|
||||
|
|
|
|||
|
|
@ -1180,6 +1180,9 @@ slap_tool_entry_check(
|
|||
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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue