- fand.f_dn = e->e_ndn;
- fand.f_next = xf.f_or == filter ? filter : &xf ;
-
-
-#ifdef BDB_FILTER_INDICES
- rc = bdb_filter_candidates( be, range, &f, ids );
-#else
- /* FIXME: Original code:
- BDB_IDL_ID( bdb, ids, e->e_id );
- * this is a hack to make "" base work; when bdb_filter_candidates
- * is used this should not be needed any more */
- BDB_IDL_ID( bdb, ids, (e->e_id == NOID ? 1 : e->e_id) );
- rc = 0;
+ scopef.f_dn = &e->e_nname;
+ scopef.f_next = xf.f_or == filter ? filter : &xf ;
+
+#ifdef BDB_SUBENTRIES
+ if( get_subentries_visibility( op ) ) {
+ struct berval bv_subentry = { sizeof("SUBENTRY")-1, "SUBENTRY" };
+ sf.f_choice = LDAP_FILTER_EQUALITY;
+ sf.f_ava = &aa_subentry;
+ sf.f_av_desc = slap_schema.si_ad_objectClass;
+ sf.f_av_value = bv_subentry;
+ sf.f_next = scopef.f_next;
+ scopef.f_next = &sf;
+ }