ldap/servers/slapd/opshared.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
New commits:
commit 46934c07d9fb1d04f6059793a041931b33de092b
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Jun 22 13:55:02 2010 -0700
606920 - anonymous resource limit - nstimelimit -
also applied to "cn=directory manager"
https://bugzilla.redhat.com/show_bug.cgi?id=606920
Description: When a timelimit (as well as a sizelimit) is successfully
retrieved from SLAPIResLimitConnData, the value is always set to pblock.
With this change, it sets "no limit (-1)" if the operation is initiated
by Directory Manager.
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index e07888c..d06dd2d 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -1370,12 +1370,14 @@ compute_limits (Slapi_PBlock *pb)
}
}
- if ( requested_timelimit == 0 ) {
- timelimit = ( max_timelimit == -1 ) ? -1 : max_timelimit;
+ if ( isroot ) {
+ timelimit = max_timelimit = -1; /* no limit */
+ } else if ( requested_timelimit == 0 ) {
+ timelimit = ( max_timelimit == -1 ) ? -1 : max_timelimit;
} else if ( max_timelimit == -1 || requested_timelimit < max_timelimit ) {
- timelimit = requested_timelimit;
+ timelimit = requested_timelimit;
} else {
- timelimit = max_timelimit;
+ timelimit = max_timelimit;
}
set_timelimit:
@@ -1399,12 +1401,14 @@ compute_limits (Slapi_PBlock *pb)
}
}
- if ( requested_sizelimit == 0 ) {
- sizelimit = ( max_sizelimit == -1 ) ? -1 : max_sizelimit;
+ if ( isroot ) {
+ sizelimit = max_sizelimit = -1;
+ } else if ( requested_sizelimit == 0 ) {
+ sizelimit = ( max_sizelimit == -1 ) ? -1 : max_sizelimit;
} else if ( max_sizelimit == -1 || requested_sizelimit < max_sizelimit ) {
- sizelimit = requested_sizelimit;
+ sizelimit = requested_sizelimit;
} else {
- sizelimit = max_sizelimit;
+ sizelimit = max_sizelimit;
}
slapi_pblock_set(pb, SLAPI_SEARCH_SIZELIMIT, &sizelimit);