Re: ldap_ssl_client_init equivalent?

2010-03-30 Thread masarati
 Hi,

 is there a ldap_ssl_client_init function in the openldap C API? I couldn't
 find any in the openldap header files.

Because there isn't.


 What is the equivalent of the following ldapsearch query in C using the
 API, on Linux?

 ldapsearch -x -H 'ldaps://activedirectory.abc.com/636'
 -b 'dc=abc,dc=com' -D 'testdn'
 -W '((objectclass=user)(!(objectclass=computer))(samaccountname=myname))'
 samaccountname

You can find that information in

clients/tools/common.c
clients/tools/ldapsearch.c

p.



Re: ldap_ssl_client_init equivalent?

2010-03-30 Thread Howard Chu

phi...@free.fr wrote:

Hi,

is there a ldap_ssl_client_init function in the openldap C API? I couldn't

find any in the openldap header files.

No, nor is one needed. A single ldap_initialize() API does everything needed 
for all LDAP session types. Requiring a separate API for each connection type 
would be stupid, and require pointless API revving when new types are added.



What is the equivalent of the following ldapsearch query in C using the API, on 
Linux?


If you want to know how ldapsearch does a query in C, just read the ldapsearch 
source code.



ldapsearch -x -H 'ldaps://activedirectory.abc.com/636'
-b 'dc=abc,dc=com' -D 'testdn'
-W '((objectclass=user)(!(objectclass=computer))(samaccountname=myname))'
samaccountname


--
  -- Howard Chu
  CTO, Symas Corp.   http://www.symas.com
  Director, Highland Sun http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/