From 654f21b2374610765c4846108728b4cd1e1c501d Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Fri, 5 Mar 1999 19:14:23 +0000 Subject: [PATCH] Implemented newSuperior handling. --- servers/slapd/back-perl/modrdn.c | 3 +++ servers/slapd/back-shell/modrdn.c | 3 +++ servers/slapd/back-tcl/tcl_modrdn.c | 17 ++++++++++++----- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/servers/slapd/back-perl/modrdn.c b/servers/slapd/back-perl/modrdn.c index 1542956c88..12808fdf5e 100644 --- a/servers/slapd/back-perl/modrdn.c +++ b/servers/slapd/back-perl/modrdn.c @@ -60,6 +60,9 @@ perl_back_modrdn( XPUSHs(sv_2mortal(newSVpv( dn , 0 ))); XPUSHs(sv_2mortal(newSVpv( newrdn , 0 ))); XPUSHs(sv_2mortal(newSViv( deleteoldrdn ))); + if ( newSuperior != NULL ) { + XPUSHs(sv_2mortal(newSVpv( newSuperior , 0 ))); + } PUTBACK ; count = perl_call_method("modrdn", G_SCALAR); diff --git a/servers/slapd/back-shell/modrdn.c b/servers/slapd/back-shell/modrdn.c index 22feda1e5d..d42742ca4c 100644 --- a/servers/slapd/back-shell/modrdn.c +++ b/servers/slapd/back-shell/modrdn.c @@ -57,6 +57,9 @@ shell_back_modrdn( fprintf( wfp, "dn: %s\n", dn ); fprintf( wfp, "newrdn: %s\n", newrdn ); fprintf( wfp, "deleteoldrdn: %d\n", deleteoldrdn ? 1 : 0 ); + if (newSuperior != NULL) { + fprintf( wfp, "newSuperior: %s\n", newSuperior ); + } fclose( wfp ); /* read in the results and send them along */ diff --git a/servers/slapd/back-tcl/tcl_modrdn.c b/servers/slapd/back-tcl/tcl_modrdn.c index 1dac7444c8..e6af8b2b03 100644 --- a/servers/slapd/back-tcl/tcl_modrdn.c +++ b/servers/slapd/back-tcl/tcl_modrdn.c @@ -1,6 +1,6 @@ /* modrdn.c - tcl modify rdn routines * - * $Id: tcl_modrdn.c,v 1.5 1999/02/28 04:55:49 bcollins Exp $ + * $Id: tcl_modrdn.c,v 1.6 1999/03/05 02:42:46 gomez Exp $ * * Copyright 1999, Ben Collins , All rights reserved. * @@ -55,10 +55,17 @@ tcl_back_modrdn ( suf_tcl = Tcl_Merge (i, be->be_suffix); command = (char *) ch_malloc (strlen (ti->ti_modrdn) + strlen (suf_tcl) - + strlen (dn) + strlen (newrdn) + 64); - sprintf (command, "%s MODRDN {%ld} {%s} {%s} {%s} %d", - ti->ti_add, op->o_msgid, suf_tcl, dn, newrdn, deleteoldrdn - ? 1 : 0); + + strlen (dn) + strlen (newrdn) + + (newSuperior ? strlen(newSuperior) : 0) + 64); + if ( newSuperior ) { + sprintf (command, "%s MODRDN {%ld} {%s} {%s} {%s} %d {%s}", + ti->ti_add, op->o_msgid, suf_tcl, dn, newrdn, + deleteoldrdn ? 1 : 0, newSuperior ); + } else { + sprintf (command, "%s MODRDN {%ld} {%s} {%s} {%s} %d", + ti->ti_add, op->o_msgid, suf_tcl, dn, newrdn, + deleteoldrdn ? 1 : 0 ); + } Tcl_Free (suf_tcl); ldap_pvt_thread_mutex_lock (&tcl_interpreter_mutex);