LDAPControl c[2];
LDAPControl **ctrls;
int err;
+ struct timeval timeout;
/* setup LDAP SYNC control */
sync_ber = ber_alloc_t( LBER_USE_DER );
if ( err != LDAP_OPT_SUCCESS )
fprintf( stderr, "Could not set controls : %d\n", err );
+ timeout.tv_sec = si->tlimit > 0 ? si->tlimit : 1;
+
rc = ldap_search_ext( ld, si->base, si->scope, si->filterstr,
si->attrs, si->attrsonly, sctrls, cctrls,
- si->tlimit, si->slimit, msgidp );
+ si->tlimit < 0 ? NULL : &timeout,
+ si->slimit, msgidp );
return rc;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR, "do_bind: Error: "
"ldap_set_option(%s,SECPROPS,\"%s\") failed!\n",
- si->mastername, si->secprops, 0 );
+ si->masteruri, si->secprops, 0 );
#else
Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option "
"(%s,SECPROPS,\"%s\") failed!\n",
- si->mastername, si->secprops, NULL );
+ si->masteruri, si->secprops, NULL );
#endif
return NULL;
}
si->ctx = ctx;
/* set memory context */
-#if 0
#define SLAB_SIZE 1048576
memsiz = SLAB_SIZE;
memctx = sl_mem_create( memsiz, ctx );
op.o_tmpmemctx = memctx;
op.o_tmpmfuncs = &sl_mfuncs;
-#else
- op.o_tmpmemctx = NULL;
- op.o_tmpmfuncs = &ch_mfuncs;
-#endif
op.o_tag = LDAP_REQ_SEARCH;
op.o_dn = si->updatedn;
op.o_connid = op.o_conn->c_connid;
op.ors_scope = LDAP_SCOPE_BASE;
op.ors_deref = LDAP_DEREF_NEVER;
- op.ors_slimit = -1;
- op.ors_tlimit = -1;
+ op.ors_slimit = 0;
+ op.ors_tlimit = 0;
op.ors_attrsonly = 0;
op.ors_attrs = NULL;
op.ors_filter = str2filter( def_filter_str = "(objectClass=*)" );
}
e = ( Entry * ) ch_calloc( 1, sizeof( Entry ));
- dnPrettyNormal( NULL, &bdn, &e->e_name, &e->e_nname, op->o_tmpmemctx );
+ dnPrettyNormal( NULL, &bdn, &e->e_name, &e->e_nname, NULL );
e->e_attrs = NULL;
op->o_tag = LDAP_REQ_SEARCH;
op->ors_scope = si->scope;
op->ors_deref = LDAP_DEREF_NEVER;
- op->ors_slimit = -1;
- op->ors_tlimit = -1;
+ op->ors_slimit = 0;
+ op->ors_tlimit = 0;
op->ors_attrsonly = 0;
op->ors_attrs = NULL;
op->ors_filter = filter;
e = ( Entry * ) ch_calloc( 1, sizeof( Entry ));
build_new_dn( &sub_bv, pdn, &psubrdn );
- dnPrettyNormal( NULL, &sub_bv, &e->e_name, &e->e_nname, op->o_tmpmemctx );
+ dnPrettyNormal( NULL, &sub_bv, &e->e_name, &e->e_nname, NULL );
ch_free( sub_bv.bv_val );
ch_free( psubrdn.bv_val );