slapi_moddn_internal()

This slapi routine moves an entry that is under a parent entry to another parent entry. In addition, it allows changing the RDN portion in a DN.

Syntax
#include <slapi-plugin.h>
Slapi_PBlock *slapi_moddn_internal(
char *olddn,
char *newrdn,
char *newsuperior,
int deloldrdn,
LDAPControl **controls,
int l);
Input Parameters
olddn
Specifies the distinguished name (DN) of an entry that is to be renamed.
newrdn
Specifies the new relative distinguished name (RDN) of an entry.
newsuperior
Specifies the DN of the parent entry to which the entry is being moved. It is provided when the entry is being moved to a new location in the directory tree.
deloldrdn
Specifies whether or not the old RDN from the entry should be removed. If the value is 1, remove the old RDN. If the value is 0, leave the RDN as an attribute of the entry.
controls
A NULL-terminated array of LDAP controls that is used in the modify RDN operation.
1
Used for compatibility with slapi APIs provided by other vendors. It is not used.
Returns
A new parameter block with the following parameter set is returned. The result code SLAPI_PLUGIN_INTOP_RESULT specifies the LDAP result code for the internal LDAP operation.
Usage
This slapi routine moves an entry that is under a specific parent entry to another parent entry. In addition, it allows changing the RDN portion in a DN. For example, if we provide the following information’s to the API:
newsuperior = “o=ABC, c=YZ”
olddn = "cn=Modify Me, o=PQR, c=XY”
newrdn = “cn=The New Me”
deloldrdn = 1
In this case, the API modifies the RDN of the Modify Me entry from Modify Me to The New Me. In addition, the entry is moved from o=PQR, c=XY to o=ABC, c=YZ.
Errors
This routine returns an error code SLAPI_PLUGIN_INTOP_RESULT, if it encounters an error.
See also
slapi_modrdn_internal().