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

ldap_search_s under windows?



Hi,
I use OpenLDAP to store certificates. Under Solaris,everything is OK. But
under windows,something is strange. I use VC6.0.
---------------------------------
#include <stdio.h>
#include <windows.h>
#include <winldap.h>

main()
{
	LDAP *ld;
	LDAPMessage *res;
	int ret,count;

	ld=ldap_open("192.9.200.6",LDAP_PORT);
	ret=ldap_simple_bind_s(ld,NULL,NULL);
	ret=ldap_search_s(ld,"c=CN",LDAP_SCOPE_SUBTREE,"(userCertificate;binary=*)",NULL,0,&res);
	count=ldap_count_entries(ld,res);
	printf("count=%d\n",count);
}
--------------------------------------------------------------
Under Solaris, the result is "count=18",it's correct. But under windows,
result is "count=0"! Why? If filter is "cn=*", the results under two platforms
are same.Only filters like "userCertificate;binary","certificateRevocationList;
binary" have the different results.

Any ideas? Thanks in advance.

----------------------------------------------
»¶Ó­Ê¹Óà 21CN µç×ÓÓʼþϵͳhttp://www.21cn.com
Thank you for using 21CN Email system