Hi, Sorry for insufficient information. In brief,am trying to connect to LDAP server using following api's
res = ldap_initialize(&ld, ldapuri); res = ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &protocol ); res = ldap_start_tls_s(ld, NULL, NULL); res = ldap_sasl_interactive_bind_s( ld, NULL, "NTLM", NULL, NULL,sasl_flags, saslInteract, &auth );
My code normally works fine, but in one senario after TLS, it crashed inside ldap_sasl_interactive_bind_s() API. Crash report says it crashed in "ber_sockbuf_ctrl + 147" inside "liblber" library. I think, it is possible to avoid the crash, If I could catch exceptions from library.
Any idea? Thanks and regards, Pratima
Hi, Sorry for insufficient information. In brief,am trying to connect to LDAP server using following api's
res = ldap_initialize(&ld, ldapuri); res = ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &protocol ); res = ldap_start_tls_s(ld, NULL, NULL); res = ldap_sasl_interactive_bind_s( ld, NULL, "NTLM", NULL, NULL,sasl_flags, saslInteract, &auth );
My code normally works fine, but in one senario after TLS, it crashed inside ldap_sasl_interactive_bind_s() API. Crash report says it crashed in "ber_sockbuf_ctrl + 147" inside "liblber" library. I think, it is possible to avoid the crash, If I could catch exceptions from library.
What about checking the return value of all calls before ldap_sasl_interactive_bind_s()? If it's not LDAP_SUCCESS, that's an exception.
p.
Thanks for your reply. In last mail, I have mentioned ldap API's used in my code. After all API call, am checking the return value. If it is success, then only am going for next api call, otherwise I will return from that point. In that crash scenario, ldap_start_tls_s() returned LDAP_SUCCESS, but it crashed inside ldap_sasl_interactive_bind_s(). That is why, I suspected ldap_start_tls_s() has corrupted the handle.
Thanks for your reply. In last mail, I have mentioned ldap API's used in my code. After all API call, am checking the return value. If it is success, then only am going for next api call, otherwise I will return from that point. In that crash scenario, ldap_start_tls_s() returned LDAP_SUCCESS, but it crashed inside ldap_sasl_interactive_bind_s(). That is why, I suspected ldap_start_tls_s() has corrupted the handle.
Please carefully read instructions here http://www.openldap.org/faq/data/cache/56.html, then report useful information about what is happening:
- a complete code snippet, without anyone having to guess what happens between the lines;
- a stack backtrace from a core dump from an *unstripped*, *non-optimized* build with *debug symbols* in your code *and* in the OpenLDAP libraries
p.
openldap-software@openldap.org