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



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

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  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 (DN). Memory for the DN will have been allocated and should be freed by a call to ldap_memfree().


Authorities and Locks

No i5/OS authority is required.


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 sent from this function.

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


Related Information


API introduced: V4R5
Top | LDAP APIs | APIs by category