ldap_rename

Asynchronously renames the specified entry.

LDAP Version:v3
Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  int ldap_rename (
     LDAP           *ld,
     const char     *dn,
     const char     *newrdn,
     const char     *newparent,
     int             deleteoldrdn,
     LDAPControl   **serverctrls,
     LDAPControl   **clientctrls,
     int            *msgidp);
  
  

Parameters

ld

(IN) Points to the handle for the LDAP session.

dn

(IN) Points to the distinguished name of the entry that is being renamed.

newrdn

(IN) Points to the new relative distinguished name to give the entry.

newparent

(IN) Points to the distinguished name of the entry's new parent. If this parameter is NULL, only the RDN is changed. The root DN is specified by passing a zero length string, "".

This function can be used with LDAP v2 servers if the newparent parameter is NULL. LDAP v2 does not allow the entry to be moved to a new parent.

deleteoldrdn

(IN) Specifies whether the old RDN should be retained or deleted.

  • Zero indicates that the old RDN should be retained. If you choose this option, the attribute will contain both names (the old and the new).

  • Non-zero indicates that the old RDN should be deleted.

serverctrls

(IN) Points to an array of LDAPControl structures that list the server controls to use with the rename. Use NULL to specify no server controls.

clientctrls

(IN) Points to an array of LDAPControl structures that list the client controls to use with the rename. Use NULL to specify no client controls.

msgidp

(OUT) Points to the message ID of the request when the rename request succeeds.

Return Values

0x00

LDAP_SUCCESS

Non-zero

Failure. For a complete list, see LDAP Return Codes.

0x53

LDAP_ENCODING_ERROR

0x5A

LDAP_NO_MEMORY

0x5C

LDAP_NOT_SUPPORTED

Remarks

The ldap_rename function changes the leaf component of an entry's distinguished name and optionally moves the entry to a new parent container.

To obtain the results of the operation, call the ldap_result function using the message ID in the msgidp parameter.

eDirectory does not currently support any server-side controls to use with renaming an entry.

See Also

ldap_rename_s