From ee751718a4e99f49c935aef06e309886e1f5beca Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Tue, 22 Jun 2010 13:55:02 -0700 Subject: 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. --- ldap/servers/slapd/opshared.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c index e07888c0..d06dd2da 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); -- cgit