summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2010-09-22 16:28:59 -0700
committerRich Megginson <rmeggins@redhat.com>2010-09-23 15:07:46 -0600
commit0db11169171d97cdea7a875b03146f5d15d2b101 (patch)
tree3e7e5b2d8131d50425f5f7c785b7c0de81fdfac0
parentd623b5e729d8dfda5cb6de0589b89c6bedb6183b (diff)
downloadds-0db11169171d97cdea7a875b03146f5d15d2b101.tar.gz
ds-0db11169171d97cdea7a875b03146f5d15d2b101.tar.xz
ds-0db11169171d97cdea7a875b03146f5d15d2b101.zip
Bug 606920 - anonymous resource limit- nstimelimit -
also applied to "cn=directory manager" https://bugzilla.redhat.com/show_bug.cgi?id=606920 Description: Client side sizelimit / timelimit request should be honoured by the Directory Manager, too. Changing the time/ sizelimit evaluation so that if client side request exists, the value is set even if the bind user is the directory manager. (cherry picked from commit f980ff61da122b39d33bf83bc20f2b7a81b6be24)
-rw-r--r--ldap/servers/slapd/opshared.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index d06dd2da..29bb3ce8 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -1370,12 +1370,18 @@ compute_limits (Slapi_PBlock *pb)
}
}
- 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;
+ if ( requested_timelimit ) {
+ /* requested limit should be applied to all (including root) */
+ if ( isroot ) {
+ timelimit = requested_timelimit;
+ } else if ( (max_timelimit == -1) ||
+ (requested_timelimit < max_timelimit) ) {
+ timelimit = requested_timelimit;
+ } else {
+ timelimit = max_timelimit;
+ }
+ } else if ( isroot ) {
+ timelimit = -1; /* no limit */
} else {
timelimit = max_timelimit;
}
@@ -1401,12 +1407,18 @@ compute_limits (Slapi_PBlock *pb)
}
}
- 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;
+ if ( requested_sizelimit ) {
+ /* requested limit should be applied to all (including root) */
+ if ( isroot ) {
+ sizelimit = requested_sizelimit;
+ } else if ( (max_sizelimit == -1) ||
+ (requested_sizelimit < max_sizelimit) ) {
+ sizelimit = requested_sizelimit;
+ } else {
+ sizelimit = max_sizelimit;
+ }
+ } else if ( isroot ) {
+ sizelimit = -1; /* no limit */
} else {
sizelimit = max_sizelimit;
}