[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#3658) libldap fails to Bind to a server on Windows



Full_Name: Alexey Melnikov
Version: 2.3
OS: Windows XP
URL: 
Submission from: (NULL) (62.3.217.250)


Building OpenLDAP (CVS HEAD) on Windows XP, I've noticed that ldapsearch 
and friends were failing to connect. After further investigation I found 
out that libraries/libldap/os-ip.c was broken:

#ifdef FD_SETSIZE
         if ( s >= FD_SETSIZE ) {
             rc = AC_SOCKET_ERROR;
             tcp_close( s );
             ldap_pvt_set_errno( EMFILE );
             return rc;
         }
#endif

This doesn't work on Windows, I got "s" value bigger than 1900 and it is 
of course bigger than FD_SETSIZE == 128 (or whatever the default is on 
Windows). On Windows fd_set is a struct containing an array of
sockets, so this check should not be done. A fix is to wrap the code in
#ifndef HAVE_WINSOCK/#endif.