}
/* delete from parent's id2children entry */
- if( (pdn = dn_parent( be, e->e_ndn )) != NULL ) {
+ if( (pdn = dn_parent( be, e->e_ndn )) != NULL && pdn[ 0 ] != '\0' ) {
if( (p = dn2entry_w( be, pdn, NULL )) == NULL) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
} else {
/* no parent, must be root to delete */
- if( ! be_isroot( be, op->o_ndn ) ) {
+ if( ! be_isroot( be, op->o_ndn ) && ! be_issuffix( be, "" ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
"ldbm_back_delete: (%s) has no parent & not a root.\n",