rc = ldap_back_dobind_int( lcp, op, rs, sendok, 0, 0 );
if ( rc == 0 && *lcp != NULL ) {
/* freeit, because lc_refcnt == 1 */
+ LDAP_BACK_CONN_TAINTED_SET( *lcp );
(*lcp)->lc_refcnt = 0;
LDAP_BACK_CONN_TAINTED_SET( *lcp );
(void)ldap_back_freeconn( li, *lcp, 0 );
Entry *e,
int rw )
{
+ if ( !e->e_private ) {
+ entry_free( e );
+ }
return LDAP_SUCCESS;
}
Operation *op,
void *ctx )
{
- connection_fake_init2( conn, op, ctx, 0 );
+ connection_fake_init2( conn, op, ctx, 1 );
}
void
}
int *
-slap_parse_csn_sids( BerVarray csns, int numcsns )
+slap_parse_csn_sids( BerVarray csns, int numcsns, void *memctx )
{
int i, *ret;
char *p, *q;
- ret = ch_malloc( numcsns * sizeof(int) );
+ ret = slap_sl_malloc( numcsns * sizeof(int), memctx );
for ( i=0; i<numcsns; i++ ) {
ret[i] = slap_parse_csn_sid( &csns[i] );
}
else
stamp.bv_len = end - csn_str;
if ( ad ) {
- value_add_one( &cookie->ctxcsn, &stamp );
+ struct berval bv;
+ ber_dupbv_x( &bv, &stamp, memctx );
+ ber_bvarray_add_x( &cookie->ctxcsn, &bv, memctx );
cookie->numcsns++;
}
if ( cval ) {
next++;
}
if ( cookie->numcsns ) {
- cookie->sids = slap_parse_csn_sids( cookie->ctxcsn, cookie->numcsns );
+ cookie->sids = slap_parse_csn_sids( cookie->ctxcsn, cookie->numcsns,
+ memctx );
}
return 0;
}
ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
if ( op->o_tag != LDAP_REQ_ADD && e ) {
- op->o_bd->bd_info = (BackendInfo *)on->on_info;
- be_entry_release_rw( op, e, 0 );
- op->o_bd->bd_info = (BackendInfo *)on;
+ if ( !SLAP_ISOVERLAY( op->o_bd )) {
+ op->o_bd = &db;
+ }
+ overlay_entry_release_ov( op, e, 0, on );
+ op->o_bd = b0;
}
if ( freefdn ) {
op->o_tmpfree( fc.fdn->bv_val, op->o_tmpmemctx );
ber_bvarray_dup_x( &si->si_ctxcsn, a->a_vals, NULL );
for ( i = 0; !BER_BVISNULL( &a->a_vals[i] ); i++ );
si->si_numcsns = i;
- si->si_sids = slap_parse_csn_sids( si->si_ctxcsn, i );
+ si->si_sids = slap_parse_csn_sids( si->si_ctxcsn, i, NULL );
}
overlay_entry_release_ov( op, e, 0, on );
if ( si->si_ctxcsn ) {
LDAP_SLAPD_F (int) slap_parse_csn_sid LDAP_P((
struct berval * ));
LDAP_SLAPD_F (int *) slap_parse_csn_sids LDAP_P((
- BerVarray, int ));
+ BerVarray, int, void *memctx ));
LDAP_SLAPD_F (int) slap_parse_sync_cookie LDAP_P((
struct sync_cookie *, void *memctx ));
LDAP_SLAPD_F (int) slap_init_sync_cookie_ctxcsn LDAP_P((
si->si_cookieState->cs_vals = csn;
for (i=0; !BER_BVISNULL( &csn[i] ); i++);
si->si_cookieState->cs_num = i;
- si->si_cookieState->cs_sids = slap_parse_csn_sids( csn, i );
+ si->si_cookieState->cs_sids = slap_parse_csn_sids( csn, i, NULL );
}
}
if ( si->si_cookieState->cs_num ) {
si->si_cookieState->cs_num = num;
si->si_cookieState->cs_vals = a.a_vals;
si->si_cookieState->cs_sids = slap_parse_csn_sids( a.a_vals,
- num );
+ num, NULL );
si->si_cookieState->cs_age++;
} else {
ber_bvarray_free( a.a_vals );
}
ber_scanf( ber, /*"{"*/ "}" );
}
- if ( !syncCookie_req.ctxcsn ) {
+ if ( !syncCookie.ctxcsn ) {
+ match = 1;
+ } else if ( !syncCookie_req.ctxcsn ) {
match = -1;
m = 0;
- } else if ( !syncCookie.ctxcsn ) {
- match = 1;
} else {
match = compare_csns( &syncCookie_req, &syncCookie, &m );
}
continue;
}
- if ( !syncCookie_req.ctxcsn ) {
+ if ( !syncCookie.ctxcsn ) {
+ match = 1;
+ } else if ( !syncCookie_req.ctxcsn ) {
match = -1;
m = 0;
- } else if ( !syncCookie.ctxcsn ) {
- match = 1;
} else {
match = compare_csns( &syncCookie_req, &syncCookie, &m );
}
value_add( &si->si_cookieState->cs_vals, syncCookie->ctxcsn );
free( si->si_cookieState->cs_sids );
si->si_cookieState->cs_sids = slap_parse_csn_sids(
- si->si_cookieState->cs_vals, si->si_cookieState->cs_num );
+ si->si_cookieState->cs_vals, si->si_cookieState->cs_num, NULL );
}
si->si_cookieState->cs_age++;