ldap_modrdn_s()--Perform an LDAP Modify RDN Request (Synchronous)


  Syntax
 #include <ldap.h>

 int ldap_modrdn_s(
                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_s() 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_s() performs a synchronous request.

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

LDAP_SUCCESS
if the request was successful.

another LDAP error
if the request was not successful.


Error Conditions

The ldap_modrdn_s() will return an LDAP error code if not successful. 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_modrdn_s API.

Related Information



API introduced: V4R3

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