int isroot = 0;
int scopeok = 0;
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
- int filter_hasSubordinates = 0;
- Attribute *hasSubordinates = NULL;
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
-
u_int32_t locker;
DB_LOCK lock;
}
}
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
- /*
- * is hasSubordinates used in the filter ?
- * FIXME: we may compute this directly when parsing the filter
- */
- filter_hasSubordinates = filter_has_subordinates( filter );
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
-
lcupf.f_choice = LDAP_FILTER_AND;
lcupf.f_and = &csnfnot;
lcupf.f_next = NULL;
goto test_done;
}
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
- /*
- * if hasSubordinates is used in the filter,
- * append it to the entry's attributes
- */
- if ( filter_hasSubordinates ) {
- int hs;
-
- rc = bdb_hasSubordinates( be, ps_conn, ps_op, e, &hs);
- if ( rc != LDAP_SUCCESS ) {
- goto test_done;
- }
-
- hasSubordinates = slap_operational_hasSubordinate(
- hs == LDAP_COMPARE_TRUE );
-
- if ( hasSubordinates == NULL ) {
- goto test_done;
- }
-
- hasSubordinates->a_next = e->e_attrs;
- e->e_attrs = hasSubordinates;
- }
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
-
if ( psearch_type != LCUP_PSEARCH_BY_SCOPEOUT ) {
rc = test_filter( be, ps_conn, ps_op, e, &lcupf );
} else {
rc = LDAP_COMPARE_TRUE;
}
-#ifdef SLAP_X_FILTER_HASSUBORDINATES
- if ( hasSubordinates ) {
- /*
- * FIXME: this is fairly inefficient, because
- * if hasSubordinates is among the required
- * attrs, it will be added again later;
- * maybe we should leave it and check
- * check later if it's already present,
- * if required
- */
- e->e_attrs = e->e_attrs->a_next;
- attr_free( hasSubordinates );
- }
-#endif /* SLAP_X_FILTER_HASSUBORDINATES */
-
if ( rc == LDAP_COMPARE_TRUE ) {
struct berval dn;