From 6b195e23490d2b6ad5fd16915de90a85df23f608 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julio=20S=C3=A1nchez=20Fern=C3=A1ndez?= Date: Fri, 9 Jul 1999 13:46:46 +0000 Subject: [PATCH] Put in line with prototype changes in value.c. delete_values returns LDAP_UNDEFINED_TYPE if the type is unknown, this is suspect. --- servers/slapd/back-ldbm/modify.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; -- 2.39.5