Commit b9e780e9 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#5362

parent 59de0a47
......@@ -25,6 +25,7 @@ OpenLDAP 2.4.8 Engineering
Fixed slapd segv with SASL/OTP (ITS#5259)
Fixed slapd cn=config crash on delete (ITS#5343)
Fixed slapd cn=config global acls (ITS#5352)
Fixed slapd truncated cookie (ITS#5362)
Fixed slapd str2entry with no attrs (ITS#5308)
Fixed slapd-bdb crash with modrdn (ITS#5358)
Fixed slapd-bdb segv with bdb4.6 (ITS#5322)
......
......@@ -99,6 +99,8 @@ slap_graduate_commit_csn( Operation *op )
if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
LDAP_TAILQ_REMOVE( op->o_bd->be_pending_csn_list,
csne, ce_csn_link );
Debug( LDAP_DEBUG_SYNC, "slap_graduate_commit_csn: removing %p %s\n",
csne->ce_csn.bv_val, csne->ce_csn.bv_val, 0 );
if ( op->o_csn.bv_val == csne->ce_csn.bv_val ) {
BER_BVZERO( &op->o_csn );
}
......@@ -162,6 +164,9 @@ slap_queue_csn(
pending = (struct slap_csn_entry *) ch_calloc( 1,
sizeof( struct slap_csn_entry ));
Debug( LDAP_DEBUG_SYNC, "slap_queue_csn: queing %p %s\n", csn->bv_val, csn->bv_val, 0 );
ldap_pvt_thread_mutex_lock( op->o_bd->be_pcl_mutexp );
ber_dupbv( &pending->ce_csn, csn );
......
......@@ -811,6 +811,19 @@ do_syncrep2(
if ( !BER_BVISNULL( &syncCookie.octet_str ) )
{
slap_parse_sync_cookie( &syncCookie, NULL );
if ( syncCookie.ctxcsn ) {
int i, sid = slap_parse_csn_sid( syncCookie.ctxcsn );
for ( i =0; i<si->si_cookieState->cs_num; i++ ) {
if ( si->si_cookieState->cs_sids[i] == sid &&
ber_bvcmp( syncCookie.ctxcsn, &si->si_cookieState->cs_vals[i] ) <= 0 ) {
Debug( LDAP_DEBUG_SYNC, "do_syncrep2: %s CSN too old, ignoring %s\n",
si->si_ridtxt, syncCookie.ctxcsn->bv_val, 0 );
ldap_controls_free( rctrls );
rc = 0;
goto done;
}
}
}
}
}
rc = 0;
......@@ -2708,7 +2721,6 @@ syncrepl_updateCookie(
}
ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex );
slap_graduate_commit_csn( op );
op->o_bd = be;
op->o_tmpfree( op->o_csn.bv_val, op->o_tmpmemctx );
BER_BVZERO( &op->o_csn );
......@@ -2931,10 +2943,9 @@ dn_callback(
} else if ( rc == 0 ) {
Debug( LDAP_DEBUG_SYNC,
"dn_callback : entries have identical CSN "
"%s ours %s, new %s\n",
"%s %s\n",
rs->sr_entry->e_name.bv_val,
old->a_vals[0].bv_val,
new->a_vals[0].bv_val );
old->a_vals[0].bv_val, 0 );
return LDAP_SUCCESS;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment