From: Howard Chu Date: Mon, 29 May 2006 07:24:21 +0000 (+0000) Subject: Fix modrdn with back-ldap X-Git-Tag: OPENLDAP_REL_ENG_2_4_3ALPHA~9^2~203 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=78809a70c5a2151e4ae5a3d704c815150786d004;p=openldap Fix modrdn with back-ldap --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index e9c1cd18e9..929a62a8a8 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1885,7 +1885,17 @@ retry_add:; if (( rc = slap_modrdn2mods( op, &rs_modify ))) { goto done; } + + /* RDNs must be NUL-terminated for back-ldap */ + noldp = op->orr_newrdn; + ber_dupbv_x( &op->orr_newrdn, &noldp, op->o_tmpmemctx ); + noldp = op->orr_nnewrdn; + ber_dupbv_x( &op->orr_nnewrdn, &noldp, op->o_tmpmemctx ); + rc = be->be_modrdn( op, &rs_modify ); + op->o_tmpfree( op->orr_nnewrdn.bv_val, op->o_tmpmemctx ); + op->o_tmpfree( op->orr_newrdn.bv_val, op->o_tmpmemctx ); + slap_mods_free( op->orr_modlist, 1 ); Debug( LDAP_DEBUG_SYNC, "syncrepl_entry: %s (%d)\n",