From: Kurt Zeilenga Date: Tue, 23 May 2000 01:21:47 +0000 (+0000) Subject: SLAPD_SCHEMA_NOT_COMPAT: fix up add framework X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2898 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a838ea676e27a3c5c87cad9b1d337163c14c3ce3;p=openldap SLAPD_SCHEMA_NOT_COMPAT: fix up add framework --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 7f63dc0a99..0a6e04a3e7 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -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"; diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 70d190ba34..ad397914d7 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -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 ); diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index b9edfc6b1f..1e9faea7ab 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -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 */