ldap_modrdn()--Perform an LDAP Modify RDN Request



  Syntax
 #include <ldap.h>

 int ldap_modrdn(
                LDAP        *ld,
                const char  *dn,
                const char  *newrdn,
                int          deleteoldrdn)

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

The ldap_modrdn() function is used to perform an LDAP modify relative distinguished name (RDN) operation. The function takes the distinguished name of the entry whose RDN is to be changed, and newrdn, the new RDN to give the entry. The deleteoldrdn parameter is used as a boolean value to indicate whether the old RDN values should be deleted from the entry or not.

ldap_modrdn() performs an asynchronous request. The result of the operation can be obtained by a subsequent call to ldap_result().

In LDAP V2, the ldap_modrdn() and ldap_modrdn_s() APIs were used to change the name of an LDAP entry. They could only be used to change the least significant component of a name (the RDN or relative distinguished name). LDAP V3 provides the Modify DN protocol operation that allows more general name change access. The ldap_rename() and ldap_rename_s() routines are used to change the name of an entry, and the use of the ldap_modrdn() and ldap_modrdn_s() routines are 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 RDN is to be changed.

newrdn
(Input) Specifies the new RDN to be given to the entry.

deleteoldrdn
(Input) Specifies a boolean value. When set to 1, the old RDN value is to be deleted from the entry. When set to 0, the old RDN value should be retained as a non-distinguished value.


Return Value

Message ID of the Operation Initiated
if the request was successful. A subsequent call to ldap_result(), can be used to obtain the result of the modify.

-1
if the request was not successful.


Error Conditions

If ldap_modrdn() is not successful, ld_errno will be set to indicate the error. See LDAP Client API Error Conditions for possible LDAP error code values. Use the ldap_get_errno() function to retrieve the error information.


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_modrdn API.


Related Information


API introduced: V4R3

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