From: Kurt Zeilenga Date: Sun, 18 Jul 1999 00:33:30 +0000 (+0000) Subject: Import patches mistakenly applied to OPENLDAP_DEVEL_REFERRALS. X-Git-Tag: OPENLDAP_REL_ENG_2_BP~101 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=12f481d657676b2eadf632b8dcd77f5d77e4a383;p=openldap Import patches mistakenly applied to OPENLDAP_DEVEL_REFERRALS. ldap_modify: delete of last attribute value should delete attribute (ITS#229) thr_nt: use sleep to yield --- diff --git a/libraries/libldap_r/thr_nt.c b/libraries/libldap_r/thr_nt.c index 8d79a5e2a8..21f13991b4 100644 --- a/libraries/libldap_r/thr_nt.c +++ b/libraries/libldap_r/thr_nt.c @@ -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; } diff --git a/servers/slapd/back-bdb2/modify.c b/servers/slapd/back-bdb2/modify.c index 6dee5eeace..ab38573dc2 100644 --- a/servers/slapd/back-bdb2/modify.c +++ b/servers/slapd/back-bdb2/modify.c @@ -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; } diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index d9e9b8ed4c..b5fc2c19a9 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -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; }