mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-17 04:13:55 -05:00
SLAPD_SCHEMA_NOT_COMPAT: fix up add framework
This commit is contained in:
parent
c82f96f520
commit
a838ea676e
3 changed files with 9 additions and 3 deletions
|
|
@ -98,7 +98,6 @@ int slap_bv2ad(
|
|||
|
||||
assert( ad != NULL );
|
||||
assert( *ad == NULL ); /* temporary */
|
||||
assert( *text != NULL );
|
||||
|
||||
if( bv == NULL || bv->bv_len == 0 ) {
|
||||
*text = "empty attribute description";
|
||||
|
|
|
|||
|
|
@ -96,7 +96,8 @@ do_add( Connection *conn, Operation *op )
|
|||
|
||||
/* get the attrs */
|
||||
for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
|
||||
tag = ber_next_element( ber, &len, last ) ) {
|
||||
tag = ber_next_element( ber, &len, last ) )
|
||||
{
|
||||
#ifdef SLAPD_SCHEMA_NOT_COMPAT
|
||||
LDAPModList *mod = (LDAPModList *) ch_malloc( sizeof(LDAPModList) );
|
||||
#else
|
||||
|
|
@ -131,7 +132,7 @@ do_add( Connection *conn, Operation *op )
|
|||
}
|
||||
|
||||
#ifdef SLAPD_SCHEMA_NOT_COMPAT
|
||||
(*modtail)->ml_next = mod;
|
||||
*modtail = mod;
|
||||
modtail = &mod->ml_next;
|
||||
#else
|
||||
attr_merge( e, mod->ml_type, mod->ml_bvalues );
|
||||
|
|
|
|||
|
|
@ -346,6 +346,12 @@ int slap_modlist2mods(
|
|||
slap_syntax_validate_func *validate =
|
||||
ad->ad_type->sat_syntax->ssyn_validate;
|
||||
|
||||
if( !validate ) {
|
||||
slap_mods_free( mod );
|
||||
*text = "no validator for syntax";
|
||||
return LDAP_INVALID_SYNTAX;
|
||||
}
|
||||
|
||||
/*
|
||||
* check that each value is valid per syntax
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue