mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
fix size/time limit (ITS#4145)
This commit is contained in:
parent
a00f337acd
commit
acb17be789
@ -61,19 +61,17 @@ meta_back_search_start(
|
|||||||
struct berval mfilter = BER_BVNULL;
|
struct berval mfilter = BER_BVNULL;
|
||||||
char **mapped_attrs = NULL;
|
char **mapped_attrs = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
struct timeval tv, *tvp = NULL;
|
||||||
|
|
||||||
/* should we check return values? */
|
/* should we check return values? */
|
||||||
if ( op->ors_deref != -1 ) {
|
if ( op->ors_deref != -1 ) {
|
||||||
ldap_set_option( msc->msc_ld, LDAP_OPT_DEREF,
|
ldap_set_option( msc->msc_ld, LDAP_OPT_DEREF,
|
||||||
( void * )&op->ors_deref);
|
( void * )&op->ors_deref );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( op->ors_tlimit != SLAP_NO_LIMIT ) {
|
if ( op->ors_tlimit != SLAP_NO_LIMIT ) {
|
||||||
ldap_set_option( msc->msc_ld, LDAP_OPT_TIMELIMIT,
|
tv.tv_sec = op->ors_tlimit > 0 ? op->ors_tlimit : 1;
|
||||||
( void * )&op->ors_tlimit);
|
tvp = &tv;
|
||||||
}
|
|
||||||
if ( op->ors_slimit != SLAP_NO_LIMIT ) {
|
|
||||||
ldap_set_option( msc->msc_ld, LDAP_OPT_SIZELIMIT,
|
|
||||||
( void * )&op->ors_slimit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dc->target = &mi->mi_targets[ candidate ];
|
dc->target = &mi->mi_targets[ candidate ];
|
||||||
@ -210,7 +208,7 @@ meta_back_search_start(
|
|||||||
rc = ldap_search_ext( msc->msc_ld,
|
rc = ldap_search_ext( msc->msc_ld,
|
||||||
mbase.bv_val, realscope, mfilter.bv_val,
|
mbase.bv_val, realscope, mfilter.bv_val,
|
||||||
mapped_attrs, op->ors_attrsonly,
|
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 );
|
&candidates[ candidate ].sr_msgid );
|
||||||
if ( rc == LDAP_SUCCESS ) {
|
if ( rc == LDAP_SUCCESS ) {
|
||||||
rc = 1;
|
rc = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user