Returns the distinguished name of the client associated with the LDAP connection.
#include <ldapx.h> int ldap_get_bind_dn ( LDAP *ld, char **identity);
(IN) Points to the handle for the LDAP session.
(OUT) Points to the distinguished name, in LDAP format, of the client.
0x00 |
LDAP_SUCCESS |
0x01 |
LDAP_OPERATIONS_ERROR: A string is returned with this error code that indicates the source of the error. |
0x53 |
LDAP_ENCODING_ERROR |
0x5A |
LDAP_NO_MEMORY |
0x5C |
LDAP_NOT_SUPPORTED |
Non-zero |
Non-zero values indicate errors. See |
If the connection is not authenticated and is using an anonymus bind, the function returns an empty string.
The function allocates the memory for the identity parameter, and the caller is responsible for freeing it with the ldapx_memfree function.
The first field in the structure contains the length of the name, and the second field contains the name.
For sample code, see getidname.c.
The requestName is set to the OID (2.16.840.1.113719.1.27.100.31) and the requestValue has no value.
RequestBer NULL
The responseName is set to the OID (2.16.840.1.113719.1.27.100.32) and the responseValue is a BER encoding of the following:
ResponseBer identity OCTET STRING