From: Pierangelo Masarati Date: Sat, 28 Jul 2001 11:25:00 +0000 (+0000) Subject: exploits regex-based per op_ndn time/size limits X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1193 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c78416fdbd3f5ca475bc3686aa4ae498689ee2dd;p=openldap exploits regex-based per op_ndn time/size limits --- diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 49bd4b2777..6af3cf97c9 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -53,6 +53,9 @@ ldbm_back_search( int nentries = 0; int manageDSAit = get_manageDSAit( op ); + int timelimit = -1, sizelimit = -1; + int isroot = 0; + #ifdef NEW_LOGGING LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY, "ldbm_back_search: enter\n" )); @@ -181,19 +184,28 @@ searchit: goto done; } - if ( tlimit == 0 && be_isroot( be, op->o_ndn ) ) { + if ( be_isroot( be, op->o_ndn ) ) { + isroot = 1; + } else { + if ( get_limits( be, op->o_ndn, &timelimit, &sizelimit) ) { + timelimit = be->be_timelimit; + sizelimit = be->be_sizelimit; + } + } + + if ( tlimit == 0 && isroot ) { tlimit = -1; /* allow root to set no limit */ } else { - tlimit = (tlimit > be->be_timelimit || tlimit < 1) ? - be->be_timelimit : tlimit; + tlimit = (tlimit > timelimit || tlimit < 1) ? + timelimit : tlimit; stoptime = op->o_time + tlimit; } - if ( slimit == 0 && be_isroot( be, op->o_ndn ) ) { + if ( slimit == 0 && isroot ) { slimit = -1; /* allow root to set no limit */ } else { - slimit = (slimit > be->be_sizelimit || slimit < 1) ? - be->be_sizelimit : slimit; + slimit = (slimit > sizelimit || slimit < 1) ? + sizelimit : slimit; } for ( id = idl_firstid( candidates, &cursor ); id != NOID;