From b1ed3bf10af1a8a874130c647464fe31f4b9ce3a Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 13 Jan 2014 11:26:46 -0800 Subject: [PATCH] ITS#7778 fix regression from #7329 --- servers/slapd/back-bdb/modify.c | 11 +++++++++++ servers/slapd/back-mdb/modify.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 3cab8770ee..a2d7ec03b1 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -389,6 +389,7 @@ int bdb_modify_internal( ap->a_nvals, e->e_id, SLAP_INDEX_ADD_OP ); } else { + int found = 0; /* if this was only an add, we only need to index * the added values. */ @@ -396,6 +397,7 @@ int bdb_modify_internal( struct berval *vals; if ( ml->sml_desc != ap->a_desc || !ml->sml_numvals ) continue; + found = 1; switch( ml->sml_op ) { case LDAP_MOD_ADD: case LDAP_MOD_REPLACE: @@ -415,6 +417,15 @@ int bdb_modify_internal( if ( rc ) break; } + /* This attr was affected by a modify of a subtype, so + * there was no direct match in the modlist. Just readd + * all of its values. + */ + if ( !found ) { + rc = bdb_index_values( op, tid, ap->a_desc, + ap->a_nvals, + e->e_id, SLAP_INDEX_ADD_OP ); + } } if ( rc != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_ANY, diff --git a/servers/slapd/back-mdb/modify.c b/servers/slapd/back-mdb/modify.c index 44805b6e4e..529be7194c 100644 --- a/servers/slapd/back-mdb/modify.c +++ b/servers/slapd/back-mdb/modify.c @@ -389,6 +389,7 @@ int mdb_modify_internal( ap->a_nvals, e->e_id, SLAP_INDEX_ADD_OP ); } else { + int found = 0; /* if this was only an add, we only need to index * the added values. */ @@ -396,6 +397,7 @@ int mdb_modify_internal( struct berval *vals; if ( ml->sml_desc != ap->a_desc || !ml->sml_numvals ) continue; + found = 1; switch( ml->sml_op ) { case LDAP_MOD_ADD: case LDAP_MOD_REPLACE: @@ -415,6 +417,15 @@ int mdb_modify_internal( if ( rc ) break; } + /* This attr was affected by a modify of a subtype, so + * there was no direct match in the modlist. Just readd + * all of its values. + */ + if ( !found ) { + rc = mdb_index_values( op, tid, ap->a_desc, + ap->a_nvals, + e->e_id, SLAP_INDEX_ADD_OP ); + } } if ( rc != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_ANY, -- 2.39.5