int tlimit,
Filter *filter,
const char *filterstr,
- char **attrs,
+ struct berval **attrs,
int attrsonly )
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
if ( *nbase == '\0' ) {
/* DIT root special case */
- static const Entry root = { NOID, "", "", NULL, NULL };
- e = (Entry *) &root;
+ e = (Entry *) &slap_entry_root;
/* need normalized dn below */
realbase = ch_strdup( e->e_ndn );
}
/* if not root, get appropriate limits */
- if ( be_isroot( be, op->o_ndn ) ) {
+ if ( be_isroot( be, &op->o_ndn ) ) {
isroot = 1;
} else {
- ( void ) get_limits( be, op->o_ndn, &limit );
+ ( void ) get_limits( be, &op->o_ndn, &limit );
}
/* if candidates exceed to-be-checked entries, abort */
if ( !isroot && limit->lms_s_unchecked != -1 ) {
- if ( ID_BLOCK_NIDS( candidates ) > limit->lms_s_unchecked ) {
+ if ( ID_BLOCK_NIDS( candidates ) > (unsigned) limit->lms_s_unchecked ) {
send_search_result( conn, op, LDAP_UNWILLING_TO_PERFORM,
NULL, NULL, NULL, NULL, 0 );
rc = 0;
free( pdn );
goto loop_continue;
}
- free(pdn);
}
} else if ( dn_issuffix( e->e_ndn, realbase ) ) {
/* check scope */
if ( !scopeok && scope == LDAP_SCOPE_ONELEVEL ) {
if ( (dn = dn_parent( be, e->e_ndn )) != NULL ) {
- (void) dn_normalize( dn );
scopeok = (dn == realbase)
? 1
: (strcmp( dn, realbase ) ? 0 : 1 );
- free( dn );
-
} else {
scopeok = (realbase == NULL || *realbase == '\0');
}
if( scopeok ) {
struct berval **erefs = get_entry_referrals(
be, conn, op, e, NULL, cscope );
- struct berval **refs = referral_rewrite( erefs, e->e_dn,
- NULL, scope );
+ struct berval **refs = referral_rewrite( erefs, e->e_dn, NULL,
+ scope == LDAP_SCOPE_SUBTREE
+ ? LDAP_SCOPE_SUBTREE
+ : LDAP_SCOPE_BASE );
send_search_reference( be, conn, op,
e, refs, NULL, &v2refs );
/* check scope */
if ( !scopeok && scope == LDAP_SCOPE_ONELEVEL ) {
if ( (dn = dn_parent( be, e->e_ndn )) != NULL ) {
- (void) dn_normalize( dn );
scopeok = (dn == realbase)
? 1
: (strcmp( dn, realbase ) ? 0 : 1 );
- free( dn );
-
} else {
scopeok = (realbase == NULL || *realbase == '\0');
}