]> git.sur5r.net Git - openldap/commitdiff
Import patches mistakenly applied to OPENLDAP_DEVEL_REFERRALS.
authorKurt Zeilenga <kurt@openldap.org>
Sun, 18 Jul 1999 00:33:30 +0000 (00:33 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 18 Jul 1999 00:33:30 +0000 (00:33 +0000)
ldap_modify: delete of last attribute value should delete attribute (ITS#229)
thr_nt: use sleep to yield

libraries/libldap_r/thr_nt.c
servers/slapd/back-bdb2/modify.c
servers/slapd/back-ldbm/modify.c

index 8d79a5e2a8c9d673f60a29707cf75c4173e0f1f4..21f13991b4de390f1698cc4ac608d134e181d7e2 100644 (file)
@@ -65,6 +65,7 @@ ldap_pvt_thread_kill( ldap_pvt_thread_t thread, int signo )
 int 
 ldap_pvt_thread_yield( void )
 {
+       Sleep( 0 );
        return 0;
 }
 
index 6dee5eeace02004e38859c6d19b59ad914ebecf3..ab38573dc246cf39fa65e1afe6e29b7ecc6e5d5b 100644 (file)
@@ -355,6 +355,17 @@ bdb2i_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;
                }
 
index d9e9b8ed4c9b2e7935f8d47d037c9e886690ab0a..b5fc2c19a91b719cd2123f2b2f8dbc38cc6aa66b 100644 (file)
@@ -367,6 +367,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;
                }