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

Nathan Kinder (nkinder) fedora-directory-commits at redhat.com
Thu Jul 10 22:47:12 UTC 2008


Author: nkinder

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

Modified Files:
      Tag: Directory_Server_8_0_Branch
	index.c 
Log Message:
Resolves: 452169
Summary: Crash in indexing code when attribute is missing.



Index: index.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/index.c,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -r1.13 -r1.13.2.1
--- index.c	4 Oct 2007 03:28:19 -0000	1.13
+++ index.c	10 Jul 2008 22:47:10 -0000	1.13.2.1
@@ -652,13 +652,21 @@
                  * 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,




More information about the Fedora-directory-commits mailing list