From: Pierangelo Masarati Date: Fri, 4 Nov 2005 12:42:39 +0000 (+0000) Subject: fix size/time limit (ITS#4145) X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~101 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=acb17be78950dce55d45d4674e13bfcf064e3d03;p=openldap fix size/time limit (ITS#4145) --- diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index ccd058c2a4..d621b43307 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -61,19 +61,17 @@ meta_back_search_start( struct berval mfilter = BER_BVNULL; char **mapped_attrs = NULL; int rc; + struct timeval tv, *tvp = NULL; /* should we check return values? */ if ( op->ors_deref != -1 ) { ldap_set_option( msc->msc_ld, LDAP_OPT_DEREF, - ( void * )&op->ors_deref); + ( void * )&op->ors_deref ); } + if ( op->ors_tlimit != SLAP_NO_LIMIT ) { - ldap_set_option( msc->msc_ld, LDAP_OPT_TIMELIMIT, - ( void * )&op->ors_tlimit); - } - if ( op->ors_slimit != SLAP_NO_LIMIT ) { - ldap_set_option( msc->msc_ld, LDAP_OPT_SIZELIMIT, - ( void * )&op->ors_slimit); + tv.tv_sec = op->ors_tlimit > 0 ? op->ors_tlimit : 1; + tvp = &tv; } dc->target = &mi->mi_targets[ candidate ]; @@ -210,7 +208,7 @@ meta_back_search_start( rc = ldap_search_ext( msc->msc_ld, mbase.bv_val, realscope, mfilter.bv_val, mapped_attrs, op->ors_attrsonly, - op->o_ctrls, NULL, NULL, op->ors_slimit, + op->o_ctrls, NULL, tvp, op->ors_slimit, &candidates[ candidate ].sr_msgid ); if ( rc == LDAP_SUCCESS ) { rc = 1;