]> git.sur5r.net Git - openldap/commitdiff
Fix modrdn with back-ldap
authorHoward Chu <hyc@openldap.org>
Mon, 29 May 2006 07:24:21 +0000 (07:24 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 29 May 2006 07:24:21 +0000 (07:24 +0000)
servers/slapd/syncrepl.c

index e9c1cd18e934eb294b5653dcc2f2f0fb251e048a..929a62a8a86b5622b7c3fa261dc0944db7db40eb 100644 (file)
@@ -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",