Hi,
I am facing problem while in ldap_simple_bind () while setting LDAP_OPT_NETWORK_TIMEOUT. Can anybody let me know if I am missing something.
Just to add some information that I have compiled the openldap-2.4.23 version on solaris 10 with sun studio compiler. The bind api “ldap_simple_bind()” is successful if don’t use LDAP_OPT_NETWORK_TIMEOUT but fails if I use.
From my application bind() method I am using the following apis
struct timeval tempTime;
tempTime.tv_usec = 0;
tempTime.tv_sec = 10;
ldap_init((char*)theHost.c_str(), thePort);
ldap_set_option(theLDAP, LDAP_OPT_PROTOCOL_VERSION, &desired_version);
ldap_set_option(theLDAP, LDAP_OPT_DEREF, &desired_deref);
ldap_set_option( theLDAP, LDAP_OPT_NETWORK_TIMEOUT, (void *)&tempTime );
ldap_simple_bind(theLDAP, (char*)theUserDN, (char*)theUserPW);
here I am getting a bind failure and from openldap library in ldap_sasl_bind(…) of libldap_r/sasl.c where the following code fails and ld->ld_errno returns -1
/* send the message */
*msgidp = ldap_send_initial_request( ld, LDAP_REQ_BIND, dn, ber, id );
printf("returning ld->ld_errno %d\n",ld->ld_errno);
Could anybody help me to know if I am missing anything here (Don’t know may be to set some ldap options or missed some compilation flag, not sure).
Hope someone will help me to solve this issue.
If anybody has a sample client code with ldap option set to LDAP_OPT_NETWORK_TIMEOUT. Please send me.
Regards,
Pravat