[Date Prev][Date Next] [Chronological] [Thread] [Top]

ldap_delete behaves wrong (ITS#229)



Full_Name: Christian Forster
Version: 1.2.4
OS: Linux
URL: 
Submission from: (NULL) (131.188.28.42)


Hi Folks!

ldap_delete seems to behave wrong: If you try to delete the values of
an attribute one by one, the attribute itself isn't removed after the last
value
has been gone.
The following patch should fix this situation.

Regards,
	Christian Forster


--- ldap/servers/slapd/back-ldbm/modify.c       Thu Jul  8 20:40:03 1999
+++ ldap-patched/servers/slapd/back-ldbm/modify.c       Sat Jul 17 20:29:33
1999
@@ -324,6 +324,14 @@
                                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;
                }