From: Howard Chu Date: Mon, 5 Feb 2007 06:07:27 +0000 (+0000) Subject: Add entryCSN comparison for consistency check X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~85 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f41343aa2151ce193d8a6447c844402367a4b1f6;p=openldap Add entryCSN comparison for consistency check --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index ac31996121..dd323ff6af 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2696,6 +2696,16 @@ dn_callback( modtail = &dni->mods; ml = dni->modlist; + /* 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 && ber_bvcmp( &old->a_vals[0], + &new->a_vals[0] ) >= 0 ) { + return LDAP_SUCCESS; + } + /* We assume that attributes are saved in the same order * in the remote and local databases. So if we walk through * the attributeDescriptions one by one they should match in