From 33162c1aef3605cecab01af5d04f6b992c7e1895 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 12 Nov 2007 08:14:50 +0000 Subject: [PATCH] ITS#5230 fix slimit for rootDN w/pagedresults --- servers/slapd/limits.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 ); -- 2.39.5