Make two successive modifications of the same attribute separate. This
lets the consumer interpret the log entry the same way as the server
that produced it.
Still depends on the log entry attributes being read in the same order
as they were written.
case LOG_EN_MODRDN:
case LOG_EN_MODIFY:
case LOG_EN_MODRDN:
case LOG_EN_MODIFY:
- /* count all the mods */
+ /* count all the mods + attributes (ITS#6545) */
i = 0;
for ( m = op->orm_modlist; m; m = m->sml_next ) {
if ( m->sml_values ) {
i = 0;
for ( m = op->orm_modlist; m; m = m->sml_next ) {
if ( m->sml_values ) {
+ if ( m->sml_next && m->sml_desc == m->sml_next->sml_desc ) {
+ i++;
+ }
}
vals = ch_malloc( (i+1) * sizeof( struct berval ));
i = 0;
}
vals = ch_malloc( (i+1) * sizeof( struct berval ));
i = 0;
+ /* ITS#6545: when the same attribute is edited multiple times,
+ * record the transition */
+ if ( m->sml_next && m->sml_desc == m->sml_next->sml_desc ) {
+ ber_str2bv( ":", STRLENOF(":"), 1, &vals[i] );
+ i++;
+ }
if ( !colon ) {
/* Invalid */
continue;
if ( !colon ) {
/* Invalid */
continue;
+ } else if ( colon == bv.bv_val ) {
+ /* ITS#6545: An empty attribute signals that a new mod
+ * is about to start */
+ mod = NULL;
+ continue;
}
bv.bv_len = colon - bv.bv_val;
}
bv.bv_len = colon - bv.bv_val;
dn: cn=Mark Elliot,ou=Alumni Association,ou=People,dc=example,dc=com
changetype: modify
replace: drink
dn: cn=Mark Elliot,ou=Alumni Association,ou=People,dc=example,dc=com
changetype: modify
replace: drink
+drink: Red Wine
+-
+replace: drink
dn: cn=All Staff,ou=Groups,dc=example,dc=com
changetype: modrdn
dn: cn=All Staff,ou=Groups,dc=example,dc=com
changetype: modrdn
+$LDAPMODIFY -D "$MANAGERDN" -H $URI1 -w $PASSWD \
+ >> $TESTOUT 2>&1 << EOF
+dn: $THEDN
+changetype: modify
+replace: sn
+sn: Replaced later
+-
+replace: sn
+sn: Surname
+EOF
+RC=$?
+if test $RC != 0 ; then
+ echo "ldapmodify failed for server 1 database ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit $RC
+fi
+
echo "Restoring replication between server 1 and 2..."
n=1
while [ $n -le $MMR ]; do
echo "Restoring replication between server 1 and 2..."
n=1
while [ $n -le $MMR ]; do