[tpop3d-discuss] open sockets...

Chris Lightfoot chris at ex-parrot.com
Mon, 10 Jun 2002 12:08:20 +0100


On Sun, Jun 09, 2002 at 08:30:23PM -0400, Michael Klatsky wrote:
> 
> I have a system (my "semi-production" system)  which has 3 regular
> users. Doing an lsof shows 241 open tpop3d connections in either
> CLOSE_WAIT (63) or ESTABLISHED (177). These have been open for quite
> awhile (hours).

Oops. This ought to fix it, I think....

diff -u -r1.11 auth_ldap.c
--- auth_ldap.c 2002/06/08 10:04:17     1.11
+++ auth_ldap.c 2002/06/10 11:07:28
@@ -241,7 +241,7 @@
 static int try_ldap_connect_bind(char *who, char *passwd) {
     int ret, i;
     for (i = 0; i < 3; ++i) {
-        if (auth_ldap_connect()) {
+        if (ldapinfo.ldap || auth_ldap_connect()) {
             ret = ldap_simple_bind_s(ldapinfo.ldap, who, passwd);
             if (ret == LDAP_SUCCESS)
                 return LDAP_SUCCESS;
@@ -250,7 +250,8 @@
                 ldap_unbind(ldapinfo.ldap);
                 ldapinfo.ldap = NULL;
             }
-        }
+        } else
+            ldapinfo.ldap = NULL;
     }
 
     /* OK, didn't succeed. */


-- 
A language is a dialect that has an army and a navy (Max Weinreich)