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++;
}
+ if ( m->sml_next && m->sml_desc == m->sml_next->sml_desc ) {
+ i++;
+ }
}
vals = ch_malloc( (i+1) * sizeof( struct berval ));
i = 0;
*ptr = '\0';
i++;
}
+ /* 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 ( i > 0 ) {
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;
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
exit $RC
fi
+$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