From a6d2bfe9a48fd4c6be6b94f0c8362acb8aa0e20f Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 24 Nov 2004 17:07:14 +0000 Subject: [PATCH] Persist passes test018 --- servers/slapd/overlays/syncprov.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 6ad0336f92..5c47bb0d4d 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -373,13 +373,13 @@ syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, Entry *e, int mode e_uuid.e_nname = opc->sndn; rs.sr_entry = &e_uuid; if ( opc->sreference ) { - send_search_entry( &sop, &rs ); - } else { struct berval bv; bv.bv_val = NULL; bv.bv_len = 0; rs.sr_ref = &bv; send_search_reference( &sop, &rs ); + } else { + send_search_entry( &sop, &rs ); } break; default: @@ -400,10 +400,21 @@ syncprov_matchops( Operation *op, opcookie *opc, int saveit ) Entry *e; Attribute *a; int rc; + struct berval newdn; fc.fdn = &op->o_req_ndn; + /* compute new DN */ + if ( op->o_tag == LDAP_REQ_MODRDN && !saveit ) { + struct berval pdn; + if ( op->orr_nnewSup ) pdn = *op->orr_nnewSup; + else dnParent( fc.fdn, &pdn ); + build_new_dn( &newdn, &pdn, &op->orr_nnewrdn, op->o_tmpmemctx ); + fc.fdn = &newdn; + } if ( op->o_tag != LDAP_REQ_ADD ) { + op->o_bd->bd_info = (BackendInfo *)on->on_info; rc = be_entry_get_rw( op, fc.fdn, NULL, NULL, 0, &e ); + op->o_bd->bd_info = (BackendInfo *)on; if ( rc ) return; } else { e = op->ora_e; -- 2.39.5