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

How can I replicate the ldapsearch -x option in my code?


I'm running into the following issue.

Im accessing an external ldap server to make some queries.
I have been told to use anonymous authentication.

If I do:
	ldapsearch -h -b o=MyBaseDn myfilter
I get an '16 No such attribute error'. Then I tried with:
	ldapsearch -h -x -b o=MyBaseDn myfilter
and it goes fine.

So far, so good. Then I must replicate that in my code, so I do something similar to:

ld= ldap_init
ldap_simple_bind_s (ld,NULL,NULL)
ldapsearch ....

that gives the same '16 No such attribute error' that i got when
trying ldapsearch without the -x option.
I've also tried with USER and PASWORD "",""  but the same results.
I tried as well with ldap_bind_s using LDAP_AUTH_NONE as Auth method but
that gives me an "LDAP_UNKNOWN_AUTH" error...

The question is... How can I replicate the -x option in my code?

Móviles, DVD, cámaras digitales, coleccionismo... Con unas ofertas que ni te imaginas. http://www.msn.es/Subastas/