ldap_rename_s() instead.
#include <ldap.h>
int ldap_modrdn2_s( LDAP *ld, const char *dn,
const char *newrdn, int deleteoldrdn );
ld |
Connection handle, which is a pointer to an |
dn | |
newrdn | New relative distinguished name (RDN) to assign to the entry. |
deleteoldrdn |
ldap_rename_s() function.
ldap_modrdn2_s() function modifies the relative distinguished name (RDN) of an entry in a directory and lets you specify whether or not the old RDN is retained as an attribute of the entry.
A newer version of this function, ldap_rename_s(), is available in this release of the LDAP API. ldap_modrdn2_s() (the older version of the function) is included only for backward-compatibility. If you are writing a new LDAP client, use ldap_rename_s() instead of ldap_modrdn2_s().
If you want more information on ldap_modrdn2_s(), refer to the LDAP C SDK 1.0 Programmer's Guide.
ldap_modrdn2_s() function to change the RDN of an entry from "uid=bjensen" to "uid=babs". The code removes the existing RDN "babs" from the uid attribute of the entry.
#include <ldap.h>
...
LDAP *ld;
/* Distinguished name of the entry that you want to rename. */
char *dn = "uid=bjensen, ou=People, o=Airius.com";
/* New relative distinguished name (RDN) of the entry */
char *rdn = "uid=babs";
...
/* Rename the entry */
if ( ldap_modrdn2_s( ld, dn, rdn, 1 ) != LDAP_SUCCESS ) {ldap_perror( ld, "ldap_modrdn2_s" );
return( 1 );
}
...
ldap_rename_s().
Last Updated: 10/01/98 17:06:23