X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Foverlays%2Frefint.c;h=bd2786e36f43da131882630be905b39b210c930a;hb=2dd578221b3dbaf7ba2308b63c3cc46154323cae;hp=1207bfaa492d078a734f5e73a9b0c5acdd88f987;hpb=3d48d5a3608773165ad7f6f11d7492bc297b05d6;p=openldap diff --git a/servers/slapd/overlays/refint.c b/servers/slapd/overlays/refint.c index 1207bfaa49..bd2786e36f 100644 --- a/servers/slapd/overlays/refint.c +++ b/servers/slapd/overlays/refint.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2004-2010 The OpenLDAP Foundation. + * Copyright 2004-2011 The OpenLDAP Foundation. * Portions Copyright 2004 Symas Corporation. * All rights reserved. * @@ -521,11 +521,12 @@ refint_search_cb( static int refint_repair( Operation *op, - SlapReply *rs, refint_data *id, refint_q *rq ) { dependent_data *dp; + SlapReply rs = {REP_RESULT}; + Operation op2; int rc; op->o_callback->sc_response = refint_search_cb; @@ -535,7 +536,7 @@ refint_repair( op->o_ndn = op->o_bd->be_rootndn; /* search */ - rc = op->o_bd->be_search( op, rs ); + rc = op->o_bd->be_search( op, &rs ); if ( rc != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, @@ -564,18 +565,14 @@ refint_repair( * */ + op2 = *op; for ( dp = rq->attrs; dp; dp = dp->next ) { - Operation op2 = *op; 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; - op2.o_req_ndn = dp->ndn; op2.o_bd = select_backend( &dp->ndn, 1 ); if ( !op2.o_bd ) { Debug( LDAP_DEBUG_TRACE, @@ -583,6 +580,13 @@ refint_repair( dp->dn.bv_val, 0, 0 ); continue; } + op2.o_tag = LDAP_REQ_MODIFY; + op2.orm_modlist = NULL; + op2.o_req_dn = dp->dn; + op2.o_req_ndn = dp->ndn; + /* Internal ops, never replicate these */ + op2.orm_no_opattrs = 1; + op2.o_dont_replicate = 1; /* Set our ModifiersName */ if ( SLAP_LASTMOD( op->o_bd ) ) { @@ -670,8 +674,8 @@ refint_repair( op2.o_dn = op2.o_bd->be_rootdn; op2.o_ndn = op2.o_bd->be_rootndn; - slap_op_time( &op2.o_time, &op2.o_tincr ); - if ( ( rc = op2.o_bd->be_modify( &op2, &rs2 ) ) != LDAP_SUCCESS ) { + rc = op2.o_bd->be_modify( &op2, &rs2 ); + if ( rc != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_TRACE, "refint_repair: dependent modify failed: %d\n", rs2.sr_err, 0, 0 ); @@ -694,7 +698,6 @@ refint_qtask( void *ctx, void *arg ) Connection conn = {0}; OperationBuffer opbuf; Operation *op; - SlapReply rs = {REP_RESULT}; slap_callback cb = { NULL, NULL, NULL, NULL }; Filter ftop, *fptr; refint_q *rq; @@ -771,7 +774,7 @@ refint_qtask( void *ctx, void *arg ) if ( rq->db != NULL ) { op->o_bd = rq->db; - refint_repair( op, &rs, id, rq ); + refint_repair( op, id, rq ); } else { BackendDB *be; @@ -784,7 +787,7 @@ refint_qtask( void *ctx, void *arg ) if ( be->be_search && be->be_modify ) { op->o_bd = be; - refint_repair( op, &rs, id, rq ); + refint_repair( op, id, rq ); } } }