#ifndef BDB_MULTIPLE_SUFFIXES
if ( prefix == DN_SUBTREE_PREFIX
- && ( ei->bei_id == 0 || ei->bei_parent->bei_id == 0 )) {
+ && ( ei->bei_id == 0 ||
+ ( ei->bei_parent->bei_id == 0 && op->o_bd->be_suffix[0].bv_len ))) {
BDB_IDL_ALL(bdb, ids);
return 0;
}
#ifndef BDB_MULTIPLE_SUFFIXES
if ( op->ors_scope != LDAP_SCOPE_ONELEVEL &&
( ei->bei_id == 0 ||
- ei->bei_parent->bei_id == 0 ))
+ ( ei->bei_parent->bei_id == 0 && op->o_bd->be_suffix[0].bv_len )))
{
BDB_IDL_ALL( bdb, ids );
return 0;