]> git.sur5r.net Git - openldap/commitdiff
Additional ITS#4622 fixes: don't save contextCSN on incoming context entry
authorQuanah Gibson-Mount <quanah@openldap.org>
Sat, 29 Jul 2006 00:35:50 +0000 (00:35 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Sat, 29 Jul 2006 00:35:50 +0000 (00:35 +0000)
servers/slapd/syncrepl.c

index 9fcdc17112831ec23eb743e35f7c3f8503b24a13..901e65433c107b16ade6b1cd16ea921864656cdc 100644 (file)
@@ -1749,6 +1749,22 @@ syncrepl_entry(
                        ber_memfree( a->a_vals[0].bv_val );
                        ber_dupbv( &a->a_vals[0], &syncUUID_strrep );
                }
+               /* Don't save the contextCSN on the inooming context entry,
+                * we'll write it when syncrepl_updateCookie eventually
+                * gets called. (ITS#4622)
+                */
+               if ( syncstate == LDAP_SYNC_ADD && dn_match( &entry->e_nname,
+                       &be->be_nsuffix[0] )) {
+                       Attribute **ap;
+                       for ( ap = &entry->e_attrs; *ap; ap=&(*ap)->a_next ) {
+                               a = *ap;
+                               if ( a->a_desc == slap_schema.si_ad_contextCSN ) {
+                                       *ap = a->a_next;
+                                       attr_free( a );
+                                       break;
+                               }
+                       }
+               }
        }
 
        slap_op_time( &op->o_time, &op->o_tincr );