[Samba] Different behaviour of samba share in XP and Windows 2003 Server

Kiran VM kiran.vm at gmail.com
Thu Mar 24 14:28:26 GMT 2005


I have an MFC program that access a file in the samba (3.0.10) share
with the following code.

	CString strSearchPath = _T("\\\\TestServer\\TestShare\\tempfile.txt");
		CStdioFile fValueFile;
		if( !fValueFile.Open(strSearchPath,CFile::modeReadWrite  ) )

		//CloseHandle( (HANDLE)fValueFile.m_hFile );

If i run this code on a Windows 2003 server, it leaves one HANDLE
open. but if i try this operation from a windows XP ( with SP2) 
machine, every thing is fine.

Also this leak seems to happen only for a samba share. If the
"strSearchPath" is replaced with a Windows share, there is no leak.

Number of files opened by our application is quite large and so may
handles ( in 1000s ) are held up by the application. With the help of
procexp utility i found that the handle used was a file handle
(\\TestServer\\TestShare\ wrt to the sample code above. file name was
not shown).

Did any one face a similar problem?

Any idea whether this problem is Samba related (since this happens
only for samba shares)  ?

Any help/pionter in this regard will be of great help.

With best regards,

PS: My smb.conf is given below

        workgroup = NMUSOL
        netbios name = TestServer
        interfaces =
        bind interfaces only = Yes
        security = DOMAIN
        password server =
        log level = 2
        ldap ssl = no
        kernel oplocks = no

        path = /export/home1/TestShare
        read only = No
        oplocks = no
        strict locking = yes
        level2 oplocks = no

More information about the samba mailing list