Issue 667 - Inconsistent use of tcp_close() causes handle leaks
Summary: Inconsistent use of tcp_close() causes handle leaks
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-08-16 19:36 UTC by jay.sillars@spanlink.com
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jay.sillars@spanlink.com 2000-08-16 19:36:21 UTC
Full_Name: Jay Sillars
Version: 1.2.11
OS: WinNT
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (209.46.83.137)


On the windows platform socket file descriptors must be closed with the
closesocket function rather than the close function.  The close function will
fail, and the program will leak handles.  The macro tcp_close() does this
correctly, but is not being called consistently.  Here are the lines I found
that should be changed to use tcp_close() instead of close():

openldap-1.2.11\clients\gopher\go500.c(253):			close( s );
openldap-1.2.11\clients\gopher\go500.c(262):			close( ns );
openldap-1.2.11\clients\gopher\go500gw.c(281):			close( s );
openldap-1.2.11\clients\gopher\go500gw.c(290):			close( ns );
openldap-1.2.11\libraries\libldap\cldap.c(87):	close( s );
openldap-1.2.11\libraries\libldap\cldap.c(92):	close( s );
openldap-1.2.11\libraries\libldap\cldap.c(98):	close( s );
openldap-1.2.11\libraries\libldap\cldap.c(133):			close( s );
openldap-1.2.11\libraries\libldap\cldap.c(142):		    close( s );
openldap-1.2.11\libraries\libldap\cldap.c(157):	    close( s );
openldap-1.2.11\servers\ldapd\main.c(420):			close(ns);
openldap-1.2.11\servers\ldapd\main.c(438):		close( tcps );
openldap-1.2.11\servers\ldapd\main.c(452):			close( tcps );
openldap-1.2.11\servers\ldapd\main.c(469):			close( ns );
openldap-1.2.11\servers\ldapd\main.c(476):			close( ns );
openldap-1.2.11\servers\slapd\daemon.c(400):	close( tcps );
openldap-1.2.11\servers\slapd\main.c(292):				close( c.c_sb.sb_sd );
openldap-1.2.11\servers\slapd\result.c(454):		close( conn->c_sb.sb_sd );
Comment 1 Kurt Zeilenga 2000-08-16 20:35:45 UTC
1.2.11 NT support is known to be incomplete, quite experimental,
and unsupported.  In fact, nothing past the basic clients has
ever worked.  2.0, when released, will contain a more complete
NT port.

In the meantime, for SDKs, I suggest using the Mozilla/Netscape SDKs
or those available from Microsoft.  For a server, you can try
the Eudora slapd port (http://www.eudora.com/), buy something, or
wait.

You are, of course, welcomed to help in the development of our
NT port.  See the developer's FAQ and developer's list for more
info.

Kurt

At 07:36 PM 8/16/00 +0000, jay.sillars@spanlink.com wrote:
>Full_Name: Jay Sillars
>Version: 1.2.11
>OS: WinNT
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (209.46.83.137)
>
>
>On the windows platform socket file descriptors must be closed with the
>closesocket function rather than the close function.  The close function will
>fail, and the program will leak handles.  The macro tcp_close() does this
>correctly, but is not being called consistently.  Here are the lines I found
>that should be changed to use tcp_close() instead of close():
>
>openldap-1.2.11\clients\gopher\go500.c(253):                    close( s );
>openldap-1.2.11\clients\gopher\go500.c(262):                    close( ns );
>openldap-1.2.11\clients\gopher\go500gw.c(281):                  close( s );
>openldap-1.2.11\clients\gopher\go500gw.c(290):                  close( ns );
>openldap-1.2.11\libraries\libldap\cldap.c(87):  close( s );
>openldap-1.2.11\libraries\libldap\cldap.c(92):  close( s );
>openldap-1.2.11\libraries\libldap\cldap.c(98):  close( s );
>openldap-1.2.11\libraries\libldap\cldap.c(133):                 close( s );
>openldap-1.2.11\libraries\libldap\cldap.c(142):             close( s );
>openldap-1.2.11\libraries\libldap\cldap.c(157):     close( s );
>openldap-1.2.11\servers\ldapd\main.c(420):                      close(ns);
>openldap-1.2.11\servers\ldapd\main.c(438):              close( tcps );
>openldap-1.2.11\servers\ldapd\main.c(452):                      close( tcps );
>openldap-1.2.11\servers\ldapd\main.c(469):                      close( ns );
>openldap-1.2.11\servers\ldapd\main.c(476):                      close( ns );
>openldap-1.2.11\servers\slapd\daemon.c(400):    close( tcps );
>openldap-1.2.11\servers\slapd\main.c(292):                              close( c.c_sb.sb_sd );
>openldap-1.2.11\servers\slapd\result.c(454):            close( conn->c_sb.sb_sd );

Comment 2 Kurt Zeilenga 2000-08-17 15:48:27 UTC
changed notes
changed state Open to Closed
Comment 3 OpenLDAP project 2014-08-01 21:06:11 UTC
NT not supported