[tpop3d-discuss]Bug in auth_ldap.c

Rafał Kupka rkupka+Listy.tpop3d at pronet.com.pl
Wed, 25 Jan 2006 06:31:55 +0100


Hello, 

When tpop3d is waiting at ldap_search_s (in line 303 of auth_ldap.c,
CVS) and SIGCHILD happens, function returns with error code 81 (Can't
contact LDAP server) and authentication fails.

More information:
http://www.openldap.org/lists/openldap-devel/200207/msg00065.html

Problem can be solved by setting LDAP_OPT_RESTART to true after
ldap_init().

I've observed that some ldap related functions are called three times in
a row if returns error. That's probably unnecessary when
LDAP_OPT_RESTART flag is set.

Another issue is using ldap protocol version 2 by default. Many servers,
specifically openldap, refuses such connections in default
configuration. I think that tpop3d should use version 3 first and then
eventually fallback to version 2 protocol.

Regards,
Kupson