]> git.sur5r.net Git - openldap/commitdiff
ITS#6730: Only update modifiersName once per entry
authorHallvard Furuseth <hallvard@openldap.org>
Wed, 1 Dec 2010 11:21:29 +0000 (11:21 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Wed, 1 Dec 2010 11:21:29 +0000 (11:21 +0000)
servers/slapd/overlays/refint.c

index 5d4c41c756e404c5e3be0e96439dfb323ec2ca82..1207bfaa492d078a734f5e73a9b0c5acdd88f987 100644 (file)
@@ -566,10 +566,12 @@ refint_repair(
 
        for ( dp = rq->attrs; dp; dp = dp->next ) {
                Operation       op2 = *op;
-               SlapReply       rs2 = { 0 };
+               SlapReply       rs2 = {REP_RESULT};
                refint_attrs    *ra;
                Modifications   *m;
 
+               if ( dp->attrs == NULL ) continue; /* TODO: Is this needed? */
+
                op2.o_tag = LDAP_REQ_MODIFY;
                op2.orm_modlist = NULL;
                op2.o_req_dn    = dp->dn;
@@ -582,12 +584,8 @@ refint_repair(
                        continue;
                }
 
-               rs2.sr_type = REP_RESULT;
-               for ( ra = dp->attrs; ra; ra = ra->next ) {
-                       size_t  len;
-
-                       /* Set our ModifiersName */
-                       if ( SLAP_LASTMOD( op->o_bd ) ) {
+               /* Set our ModifiersName */
+               if ( SLAP_LASTMOD( op->o_bd ) ) {
                                m = op2.o_tmpalloc( sizeof(Modifications) +
                                        4*sizeof(BerValue), op2.o_tmpmemctx );
                                m->sml_next = op2.orm_modlist;
@@ -603,7 +601,10 @@ refint_repair(
                                BER_BVZERO( &m->sml_nvalues[1] );
                                m->sml_values[0] = id->refint_dn;
                                m->sml_nvalues[0] = id->refint_ndn;
-                       }
+               }
+
+               for ( ra = dp->attrs; ra; ra = ra->next ) {
+                       size_t  len;
 
                        /* Add values */
                        if ( ra->dont_empty || !BER_BVISEMPTY( &rq->newdn ) ) {