[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm index.c, 1.11, 1.12

Noriko Hosoi (nhosoi) fedora-directory-commits at redhat.com
Fri Sep 28 23:46:43 UTC 2007


Author: nhosoi

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12769/servers/slapd/back-ldbm

Modified Files:
	index.c 
Log Message:
Resolves #222918
Summary: server crash after deleting supposedly deleted attribute
Description:
index.c: if there is no attribute to delete, don't call index_addordel_values_svstring.c: changed string_values2keys to handle NULL bvals



Index: index.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/index.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- index.c	28 Sep 2007 22:54:16 -0000	1.11
+++ index.c	28 Sep 2007 23:46:40 -0000	1.12
@@ -628,9 +628,12 @@
                     flags = BE_INDEX_DEL|BE_INDEX_PRESENCE|BE_INDEX_EQUALITY;
                 }
 
-		/* Update the index */
-                index_addordel_values_sv( be, mods[i]->mod_type,
-                                              deleted_valueArray, evals, id, flags, txn);
+                /* Update the index, if necessary */
+                if (deleted_valueArray) {
+                    index_addordel_values_sv( be, mods[i]->mod_type,
+                                              deleted_valueArray, evals, id, 
+                                              flags, txn );
+                }
 
                 slapi_valueset_free(mod_vals);
             } else {
@@ -645,18 +648,18 @@
                     flags = BE_INDEX_DEL;
                 }
 
-		/* If the same value doesn't exist in a subtype, set
-		 * BE_INDEX_EQUALITY flag so the equality index is
-		 * removed.
-		 */
-		slapi_entry_attr_find( olde->ep_entry, mods[i]->mod_type, &curr_attr);
+                /* If the same value doesn't exist in a subtype, set
+                 * 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 ( valuearray_find(curr_attr, evals, mods_valueArray[j]) == -1 ) {
                         if (!(flags & BE_INDEX_EQUALITY)) {
-		            flags |= BE_INDEX_EQUALITY;
+                            flags |= BE_INDEX_EQUALITY;
                         }
                     }
-		}
+                }
 
                 rc = index_addordel_values_sv( be, basetype,
                                                mods_valueArray,




More information about the Fedora-directory-commits mailing list