From: Julio Sánchez Fernández Date: Fri, 9 Jul 1999 13:46:46 +0000 (+0000) Subject: Put in line with prototype changes in value.c. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6b195e23490d2b6ad5fd16915de90a85df23f608;p=openldap Put in line with prototype changes in value.c. delete_values returns LDAP_UNDEFINED_TYPE if the type is unknown, this is suspect. --- diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index df8aca12d9..ab7be1d0ff 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -281,7 +281,7 @@ add_values( at = at_find( mod->mod_type ); for ( i = 0; mod->mod_bvalues[i] != NULL; i++ ) { if ( value_find( a->a_vals, mod->mod_bvalues[i], - at->sat_equality, 3 ) == 0 ) { + at->sat_equality ) == 0 ) { return( LDAP_TYPE_OR_VALUE_EXISTS ); } } @@ -304,6 +304,14 @@ delete_values( { int i, j, k, found; Attribute *a; + AttributeType *at; + + at = at_find( mod->mod_type ); + if ( !at ) { + Debug( LDAP_DEBUG_ARGS, "unknown attribute type %s\n", + mod->mod_type, 0, 0 ); + return( LDAP_UNDEFINED_TYPE ); + } /* delete the entire attribute */ if ( mod->mod_bvalues == NULL ) { @@ -325,7 +333,7 @@ delete_values( found = 0; for ( j = 0; a->a_vals[j] != NULL; j++ ) { if ( value_cmp( mod->mod_bvalues[i], a->a_vals[j], - a->a_syntax, 3 ) != 0 ) { + at->sat_equality ) != 0 ) { continue; } found = 1;