Commit a838ea67 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

SLAPD_SCHEMA_NOT_COMPAT: fix up add framework

parent c82f96f5
......@@ -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
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment