From: Howard Chu Date: Mon, 12 Nov 2007 08:14:50 +0000 (+0000) Subject: ITS#5230 fix slimit for rootDN w/pagedresults X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~442 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=33162c1aef3605cecab01af5d04f6b992c7e1895;p=openldap ITS#5230 fix slimit for rootDN w/pagedresults --- diff --git a/servers/slapd/limits.c b/servers/slapd/limits.c index 81f4027de3..5fbda3008c 100644 --- a/servers/slapd/limits.c +++ b/servers/slapd/limits.c @@ -1118,6 +1118,18 @@ limits_check( Operation *op, SlapReply *rs ) op->ors_slimit = SLAP_NO_LIMIT; } + /* if paged results and slimit are requested */ + if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED && + op->ors_slimit != SLAP_NO_LIMIT ) { + PagedResultsState *ps = op->o_pagedresults_state; + int total = op->ors_slimit - ps->ps_count; + if ( total > 0 ) { + op->ors_slimit = total; + } else { + op->ors_slimit = 0; + } + } + /* if not root, get appropriate limits */ } else { ( void ) limits_get( op, &op->o_ndn, &op->ors_limit );