ldap_get_dn()--Retrieve the Distinguished Name of an Entry




Syntax

#include <ldap.h>
 
char *ldap_get_dn(
		LDAP	 	*ld,
        	LDAPMessage 	*entry)




Threadsafe: Yes

The ldap_get_dn() function takes an entry as returned by ldap_first_entry() or ldap_next_entry() and returns a copy of the entry's distinguished name. Memory for the distinguished name will have been allocated and should be freed by a call to ldap_memfree().

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().
entry
(Input) The entry whose dn is to be retrieved, as returned by Specifies the LDAP pointer returned by a previous call to ldap_first_entry() or ldap_next_entry().

Return Value

Copy of the entry's DN
if the request was successful.
NULL
if the request was not successful.

Error Conditions

If ldap_get_dn() 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 ldap_get_errno() function to retrieve the error information.

Error Messages

    The following message may be set from this function.
    CPF3CF2 E  Error(s) occurred during running of ldap_get_dn API.

Related Information

    ldap_explode_dn() -- Convert a DN into its component parts.


Top | LDAP APIs List
APIs by category

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