On 19/09/17 08:00, John Lewis wrote:
On Mon, 2017-09-18 at 14:31 +1200, Martin van den Nieuwelaar wrote:
Hi People,
I'm writing an application using Qt and wish to use the openldap library within my program to query an LDAP server. I have been searching for instructions on using the library from a client point of view but have not been successful. I tried using the man pages and I think I'm part way there but have reached an impasse on the correct way (or any way at all for that matter) to extract the results from an LDAPMessage *. I have an example search working using the command line program ldap_search, so the next thought is to look at the source for ldap_search and see what calls it makes to figure things out. This somehow seems like the wrong way to be going about things however.
Is there something equivalent for openldap to the documentation for libcurl, https://ec.haxx.se/libcurl-easyhandle.html ? If there is that would be brilliant.
The libcurl library supports LDAP. Howard Chu even wrote a new LDAP implementation for it back in 2010 to make it fully asynchronous. Is there a good reason not to use it?
Thanks for the suggestion. I hadn't even thought to see if libcurl could perform LDAP queries, but indeed it looks like it can so this is definitely worth looking into.
In the interim I did get my Qt program working, not by using the openldap library calls for which I'm still none the wiser but by using Qt's very capable and well documented QProcess class for running external programs and calling the ldapsearch command line program.
Thanks again for the reply.