/*
*
* Copyright 1998 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*
* Comments:
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <string.h>
#ifdef MACOS
#include "macos.h"
#endif /* MACOS */
#endif
#include "lber.h"
#include "ldap.h"
#include "ldap-private.h"
#include "ldap-int.h"
{
int rc;
/*
* A modify rdn request looks like this:
* ModifyRDNRequest ::= SEQUENCE {
* entry LDAPDN,
* newrdn RelativeLDAPDN,
* deleteoldrdn BOOLEAN
* newSuperior [0] LDAPDN OPTIONAL
* }
*/
/* create a message to send */
return( NULLBER );
}
return( NULLBER );
}
if (newparent) {
return( NULLBER );
}
return( NULLBER );
}
/* LDAPv3 */
/* Code controls if any */
if (serverctrls && serverctrls[0]) {
return( NULLBER );
}
/* Otherwise, is there any global server ctrls ? */
return( NULLBER );
}
}
return( NULLBER );
}
return (ber);
}
/* ldap_rename - Modify the name of an entry.
* Parameters :
* ld : LDAP descriptor.
* dn : DN of the object to rename.
* newrdn : New RDN to give to the entry.
* newparent : the parent or superior entry. If NULL only RDN is changed.
* "" means the root DN.
* deleteoldrdn : Boolean to indicate wether or not to remove the old RDN value.
* serverctrls : List of Server controls.
* clientctrls : List of client controls.
* msgidp : the msg id return if renamed succeded.
*/
{
int rv;
#ifdef _REENTRANT
#endif
if ((ber = ldap_build_rename_req(ld, dn, newrdn, newparent, deleteoldrdn, serverctrls)) == NULLBER){
if (rv == LDAP_SUCCESS)
rv = LDAP_OTHER;
#ifdef _REENTRANT
#endif
return (rv);
}
/* send the message */
if (rv == -1) {
if (rv == LDAP_SUCCESS){
rv = LDAP_OTHER;
}
#ifdef _REENTRANT
#endif
return (rv);
}
#ifdef _REENTRANT
#endif
return (LDAP_SUCCESS);
}
{
int msgid;
if ((retcode = ldap_rename(ld, dn, newrdn, newparent, deleteoldrdn, serverctrls, clientctrls, &msgid)) != LDAP_SUCCESS)
return (retcode);
#ifdef _REENTRANT
#endif
if (retcode == LDAP_SUCCESS)
#ifdef _REENTRANT
#endif
return (retcode);
}