From f980ff61da122b39d33bf83bc20f2b7a81b6be24 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Wed, 22 Sep 2010 16:28:59 -0700 Subject: 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. --- ldap/servers/slapd/opshared.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c index 858bc8f7..7aec7910 100644 --- a/ldap/servers/slapd/opshared.c +++ b/ldap/servers/slapd/opshared.c @@ -1388,12 +1388,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; } @@ -1419,12 +1425,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; } -- cgit