From b116c808e854fb85f08651a00c5a452b4b1e5aa3 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: May 26 2011 17:20:44 +0000 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. (cherry picked from commit f980ff61da122b39d33bf83bc20f2b7a81b6be24) --- diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c index 761d48a..08243dd 100644 --- a/ldap/servers/slapd/opshared.c +++ b/ldap/servers/slapd/opshared.c @@ -1380,12 +1380,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; } @@ -1411,12 +1417,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; }