]> git.sur5r.net Git - openldap/commitdiff
Import ITS#44 tcp_wrapper connections bug fix from devel.
authorKurt Zeilenga <kurt@openldap.org>
Mon, 18 Jan 1999 18:41:15 +0000 (18:41 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 18 Jan 1999 18:41:15 +0000 (18:41 +0000)
servers/slapd/daemon.c

index 8cdfb1e52dd14869c8981594a4bd0e59e889c220..b03b80b9338a8ad6ad3f9609689d53d58e9eacf0 100644 (file)
@@ -237,14 +237,9 @@ slapd_daemon(
                                    "FIONBIO ioctl on %d failed\n", ns, 0, 0 );
                        }
 
-                       c[ns].c_sb.sb_sd = ns;
                        Debug( LDAP_DEBUG_CONNS, "new connection on %d\n", ns,
                            0, 0 );
 
-                       pthread_mutex_lock( &ops_mutex );
-                       c[ns].c_connid = num_conns++;
-                       pthread_mutex_unlock( &ops_mutex );
-
                        len = sizeof(from);
 
                        if ( getpeername( ns, (struct sockaddr *) &from, &len )
@@ -284,9 +279,9 @@ slapd_daemon(
                                STRING_UNKNOWN))
                        {
                                /* DENY ACCESS */
-                               Statslog( LDAP_DEBUG_STATS,
-                                "conn=%d fd=%d connection from %s (%s) denied.\n",
-                                       c[ns].c_connid, ns,
+                               Statslog( LDAP_DEBUG_ANY,
+                                "fd=%d connection from %s (%s) denied.\n",
+                                       ns,
                                                client_name == NULL ? "unknown" : client_name,
                                                client_addr == NULL ? "unknown" : client_addr,
                                  0 );
@@ -297,6 +292,11 @@ slapd_daemon(
                        }
 #endif /* HAVE_TCPD */
 
+                       c[ns].c_sb.sb_sd = ns;
+                       pthread_mutex_lock( &ops_mutex );
+                       c[ns].c_connid = num_conns++;
+                       pthread_mutex_unlock( &ops_mutex );
+
                        Statslog( LDAP_DEBUG_STATS,
                            "conn=%d fd=%d connection from %s (%s) accepted.\n",
                                c[ns].c_connid, ns,