Explorar o código

Resolves: 452169
Summary: Indexing code needs to use new entry copy to search for subtypes when deleting an attribute value.

Nathan Kinder %!s(int64=17) %!d(string=hai) anos
pai
achega
d80ddd5428
Modificáronse 1 ficheiros con 13 adicións e 5 borrados
  1. 13 5
      ldap/servers/slapd/back-ldbm/index.c

+ 13 - 5
ldap/servers/slapd/back-ldbm/index.c

@@ -652,13 +652,21 @@ index_add_mods(
                  * BE_INDEX_EQUALITY flag so the equality index is
                  * removed.
                  */
-                slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &curr_attr);
-                for (j = 0; mods_valueArray[j] != NULL; j++ ) {
-                    if ( valuearray_find(curr_attr, evals, mods_valueArray[j]) == -1 ) {
-                        if (!(flags & BE_INDEX_EQUALITY)) {
-                            flags |= BE_INDEX_EQUALITY;
+                slapi_entry_attr_find( newe->ep_entry, mods[i]->mod_type, &curr_attr);
+                if (curr_attr) {
+                    for (j = 0; mods_valueArray[j] != NULL; j++ ) {
+                        if ( valuearray_find(curr_attr, evals, mods_valueArray[j]) == -1 ) {
+                            if (!(flags & BE_INDEX_EQUALITY)) {
+                                flags |= BE_INDEX_EQUALITY;
+                            }
                         }
                     }
+                } else {
+                    /* If we didn't find the attribute in the new
+                     * entry, we should remove the equality index. */
+                    if (!(flags & BE_INDEX_EQUALITY)) {
+                        flags |= BE_INDEX_EQUALITY;
+                    }
                 }
 
                 rc = index_addordel_values_sv( be, basetype,