]> git.sur5r.net Git - openldap/commitdiff
Fixed slapd substring_comp_candidates null intersection bug (ITS#228)
authorKurt Zeilenga <kurt@openldap.org>
Tue, 20 Jul 1999 02:17:25 +0000 (02:17 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 20 Jul 1999 02:17:25 +0000 (02:17 +0000)
Fixed slapd modify: delete of last attribute value bug (ITS#229)

CHANGES
servers/slapd/back-ldbm/filterindex.c
servers/slapd/back-ldbm/modify.c

diff --git a/CHANGES b/CHANGES
index f99eda8fe9fc0d1ce8afcb434f316b1e70b906ad..27afa9f031e85b267cf3987fd6311c57c7b1ac68 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@ OpenLDAP Change Log
 
 Changes included in OpenLDAP 1.2 Release Engineering
        CVS Tag: OPENLDAP_REL_ENG_1_2
+       Fixed slapd substring_comp_candidates null intersection bug (ITS#228)
+       Fixed slapd modify: delete of last attribute value bug (ITS#229)
        Build environment
                Updated Autoconf 2.13 config.guess/config.sub
                Don't use "ln -s -f file link" (ITS#227)
index 5ad17dc0e157bb8d0e9900fe6b308ced87c2f95f..2b304d104a63ca51d8363ac39ea41d17c11dc416 100644 (file)
@@ -345,6 +345,11 @@ substring_comp_candidates(
                        idl_free( tmp );
                        idl_free( tmp2 );
                }
+
+               /* break if no candidates */
+               if( idl == NULL ) {
+                       break;
+               }
        }
 
        Debug( LDAP_DEBUG_TRACE, "<= substring_comp_candidates %lu\n",
index 04e12383c8c2e2f493b4a9f989c39719de910ab8..e0f2e2330e9509675974d8c74053fd82aa005a9d 100644 (file)
@@ -324,6 +324,17 @@ delete_values(
                                a->a_vals[k - 1] = a->a_vals[k];
                        }
                        a->a_vals[k - 1] = NULL;
+
+                       /* delete the entire attribute, if no values remain */
+                       if ( a->a_vals[0] == NULL) {
+                               Debug( LDAP_DEBUG_ARGS,
+                                       "removing entire attribute %s\n",
+                                       mod->mod_type, 0, 0 );
+                               if ( attr_delete( &e->e_attrs, mod->mod_type ) ) {
+                                       return LDAP_NO_SUCH_ATTRIBUTE;
+                               }
+                       }
+
                        break;
                }