Returns the distinguished name of an entry from a search result chain.
#include <ldap.h>
char *ldap_get_dn (
LDAP *ld,
LDAPMessage *entry);
(IN) Points to the handle for the LDAP session.
(IN) Points to the entry returned by the ldap_first_entry or the ldap_next_entry function.
The ldap_get_dn function takes an entry returned by either the ldap_first_entry or ldap_next_entry function and returns a copy of the entry's dn. It returns a pointer to this newly allocated memory. When you are finished with the name, free the memory with a call to the ldap_memfree function.
The distinguished name is returned in the UTF-8 string format as described in RFC 2253.