ldap_rename_s()--Synchronously Rename an Entry



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

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

The ldap_rename_s() routine performs a synchronous modify DN operation.

In LDAP version 2, the ldap_modrdn_s() API was used to change the name of an LDAP entry synchronously. It could only be used to change the least significant component of a name (the RDN or relative distinguished name). The LDAP V3 protocol provides the Modify DN protocol operation that allows more general name change access. The ldap_rename_s() routine is used to change the name of an entry, and the use of the ldap_modrdn_s() routine is deprecated.


Authorities and Locks

No IBM® i authority is required. All authority checking is done by the LDAP server.


Parameters

ld
(Input) Specifies the LDAP pointer returned by a previous call to ldap_init(), ldap_ssl_init(), or ldap_open().
dn
(Input) Specifies the DN of the entry whose DN is to be changed.
newrdn
(Input) Specifies the new RDN to be given to the entry.
newparent
(Input) Specifies the new parent, or superior entry. If this parameter is NULL, only the RDN of the entry is changed. The root DN may be specified by passing a zero length string, "". The newparent parameter should always be NULL when using version 2 of the LDAP protocol; otherwise the server's behavior is undefined.
deleteoldrdn
(Input) Specifies a boolean value. When set to non-zero, the old RDN value is removed from the entry. When set to 0, the old RDN value will be retained as a non-distinguished value. This parameter only has meaning if newrdn is different from the old RDN.
serverctrls
(Input) Specifies a list of LDAP server controls. This parameter may be set to null. See Controls for LDAP APIs for more information about server controls.
clientctrls
(Input) Specifies a list of LDAP client controls. This parameter may be set to null. See Controls for LDAP APIs for more information about client controls.

Return Value

LDAP_SUCCESS
if the request was successfully.

another LDAP error code
in case of an error.

Error Conditions

If ldap_rename_s() is not successful, an error code will be returned. See LDAP Client API Error Conditions for possible LDAP error code values.


Error Messages

The following message may be sent from this function.

Message ID Error Message Text
CPF3CF2 E Error(s) occurred during running of ldap_rename_s API.


Related Information

The ldap_rename_s() API supports LDAP V3 server controls and client controls.



API introduced: V4R5

[ Back to top | LDAP APIs | APIs by category ]