ldap_rename_s()--Synchronously Rename an Entry




Syntax

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




Threadsafe: Yes

In LDAP V2, the ldap_modrdn_s() API were 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). LDAP V3 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(). The ldap_modrdn_s() routine is deprecated.

The ldap_rename_s() routine initiates synchronous modify DN operation.

Authorities and Locks

No OS/400 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. When specified with the deprecated ldap_modrdn and ldap_modrdn_s APIs, dn specifies the DN of the entry whose RDN 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 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. With respect to the ldap_rename and ldap_rename_s APIs, 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 LDAP Controls for more information about server controls.

clientctrls
(Input) Specifies a list of LDAP client controls. This parameter may be set to null. See LDAP Controls 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 set from this function.
    CPF3CF2 E  Error(s) occurred during running of ldap_rename_s API.

Related Information

    ldap_rename() -- Asynchronously rename an entry.
    ldap_modrdn() -- Asynchronously modify the RDN of
      an entry (deprecated).
    ldap_modrdn_s() -- Synchronously modify the RDN of an entry (deprecated).

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


Top | LDAP APIs List
APIs by category

[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]