Commit 121bb30e authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

ITS#7657 honor unchecked limit

parent e2de8f08
......@@ -161,6 +161,12 @@ static int search_aliases(
if (rs->sr_err != LDAP_SUCCESS || MDB_IDL_IS_ZERO( aliases )) {
return rs->sr_err;
}
if ( op->ors_limit /* isroot == FALSE */ &&
op->ors_limit->lms_s_unchecked != -1 &&
MDB_IDL_N( aliases ) > (unsigned) op->ors_limit->lms_s_unchecked )
{
return LDAP_ADMINLIMIT_EXCEEDED;
}
oldsubs[0] = 1;
oldsubs[1] = e_id;
......@@ -665,6 +671,10 @@ dn2entry_retry:
scopes[1].mval.mv_data = NULL;
rs->sr_err = search_candidates( op, rs, base,
&isc, mci, candidates, stack );
if ( rs->sr_err == LDAP_ADMINLIMIT_EXCEEDED )
goto adminlimit;
ncand = MDB_IDL_N( candidates );
if ( !base->e_id || ncand == NOID ) {
/* grab entry count from id2entry stat
......@@ -696,6 +706,7 @@ dn2entry_retry:
ncand > (unsigned) op->ors_limit->lms_s_unchecked )
{
rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
adminlimit:
send_ldap_result( op, rs );
rs->sr_err = LDAP_SUCCESS;
goto done;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment