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

ITS#5866

parent 2d6669c5
......@@ -12,6 +12,7 @@ OpenLDAP 2.4.14 Engineering
Fixed slapd bconfig to return error codes (ITS#5867)
Fixed slapd syncrepl rename handling (ITS#5809)
Fixed slapd syncrepl MMR when adding new server (ITS#5850)
Fixed slapd syncrepl replication with glued DB (ITS#5866)
Fixed slapd-bdb/hdb RFC4528 control support (ITS#5861)
Fixed slapd-ldap idassert-bind validity checking (ITS#5863)
Fixed slapd-ldif numerous bugs (ITS#5408)
......
......@@ -3169,33 +3169,39 @@ dn_callback(
struct berval old_p, new_p;
int is_ctx, new_sup = 0;
/* Make sure new entry is actually newer than old entry */
old = attr_find( rs->sr_entry->e_attrs,
slap_schema.si_ad_entryCSN );
new = attr_find( dni->new_entry->e_attrs,
slap_schema.si_ad_entryCSN );
if ( new && old ) {
int rc;
ber_len_t len = old->a_vals[0].bv_len;
if ( len > new->a_vals[0].bv_len )
len = new->a_vals[0].bv_len;
rc = memcmp( old->a_vals[0].bv_val,
new->a_vals[0].bv_val, len );
if ( rc > 0 ) {
Debug( LDAP_DEBUG_SYNC,
"dn_callback : new entry is older than ours "
"%s ours %s, new %s\n",
rs->sr_entry->e_name.bv_val,
old->a_vals[0].bv_val,
new->a_vals[0].bv_val );
return LDAP_SUCCESS;
} else if ( rc == 0 ) {
Debug( LDAP_DEBUG_SYNC,
"dn_callback : entries have identical CSN "
"%s %s\n",
rs->sr_entry->e_name.bv_val,
old->a_vals[0].bv_val, 0 );
return LDAP_SUCCESS;
/* If old entry is not a glue entry, make sure new entry
* is actually newer than old entry
*/
if ( !is_entry_glue( rs->sr_entry )) {
old = attr_find( rs->sr_entry->e_attrs,
slap_schema.si_ad_objectClass );
old = attr_find( rs->sr_entry->e_attrs,
slap_schema.si_ad_entryCSN );
new = attr_find( dni->new_entry->e_attrs,
slap_schema.si_ad_entryCSN );
if ( new && old ) {
int rc;
ber_len_t len = old->a_vals[0].bv_len;
if ( len > new->a_vals[0].bv_len )
len = new->a_vals[0].bv_len;
rc = memcmp( old->a_vals[0].bv_val,
new->a_vals[0].bv_val, len );
if ( rc > 0 ) {
Debug( LDAP_DEBUG_SYNC,
"dn_callback : new entry is older than ours "
"%s ours %s, new %s\n",
rs->sr_entry->e_name.bv_val,
old->a_vals[0].bv_val,
new->a_vals[0].bv_val );
return LDAP_SUCCESS;
} else if ( rc == 0 ) {
Debug( LDAP_DEBUG_SYNC,
"dn_callback : entries have identical CSN "
"%s %s\n",
rs->sr_entry->e_name.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