[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: Client binding to a specific local address




--On Thursday, May 11, 2017 8:33 PM +0000 Daniel Le <daniel.le@exfo.com> wrote:

I'm working on an embedded LDAP application software that makes use of
the OpenLDAP client ldap and lber libraries, not the LDAP client
command-line utilities. For that reason, I didn't look into the client
utilities and narrowly thought of slapd -h (where -H option doesn't
exist).

I see the client utilities ldapsearch, ldapadd, ldapmodify... have the
[-H ldapuri] option, but the library functions ldap_search,
ldap_search_ext, ldap_add, ldap_add_ext, ldap_modify, ldap_modify_ext,
etc. don't have an equivalent input argument. Is it correct that no
client library function supports specification of a local IP address?

As I noted, the LDAP client tools all use the C API. Clearly you can pass in a URI when initializing the connection to create the filehandle that is later utilized by functions such as ldap_search, etc. I would strongly advise reading the ldap_open(3) man page, more specifically the ldap_initialize() function detailed there. I would also note that it is perfectly valid for "host" as described in the man page to be an IP address vs a literal hostname. My point in directing you to the clients is you can trivially see how they use the API to construct a connection, etc, using the LDAP C API.

Hope that helps.

--Quanah


--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
<http://www.symas.com>