diff --git a/CHANGES b/CHANGES index 9413524571345813cae8e0144b39d14521c54729..4c10f31edb4922f3784d8849abfd6ac5c607fc57 100644 --- a/CHANGES +++ b/CHANGES @@ -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) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 3c15b5b54ffc1c861db156eef93e995e6cb7d579..7026adae26f2aa74568a9948cd13ba944b28119f 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -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; + } } }