[jcifs] ServerEnum2 Problems on smb:// scan

Matthew Tippett matthew.tippett at sympatico.ca
Mon Dec 2 10:58:46 EST 2002

> The first scan for domains works fine, on subsequent scans the following
> exception occurs..
> 	What is the significance of this? Do you mean that you are scanning multiple
> 	times within the same VM instance? Or are you running the VM once, stopping,
> 	and then running 'java ...' again?

Within the same instance of the VM, is correct.

>>The stack dump against 0.7.0b9 is
> 	You cut out the exception. What is it?

That is the exception.  It is generated by

if( response.status != SmbException.NERR_Success && 
                                                     response.status != 
SmbException.ERROR_MORE_DATA ) {
	throw new SmbException( SmbException.ERRRAP, response.status, 
response.toString() );

The status = 2320 seems to be the key.  A search on MSDN indicates (as 
you have shown with net helpmsg) that it is related to an invalid or 
non-member of a domain.

> 	And not Win98?

There was the same behaviour on Windows98.  But I did no diagnosis on it.

> 	Looking at your packet capture reveals that a domain of '??D??\1\0' is being
> 	specified in the NetServerEnum2 request. This is very odd. This is either jCIFS
> 	packet corruption or you really are passing a domain parameter of that name.
> 	It is not easy for me to debug packet corruption in RAP functions. Perhaps you
> 	can add a debugging statement to NetServerEnum2.java to print out the domain
> 	string being encoded to determine which problem we're seeing.

The code does a 'new SmbFile("smb://")' and then a .listFiles().  So I 
am sure that from an API level we are not passing anything different 
between the two requests.

Unfortunately, on Friday I spent the better part of a day trying to 
repeat it across all platforms, but I couldn't repeat it.

The code change that we did do was start closing properly all 
connections when we would open.  The problem doesn't happen anymore :(

If it comes back, I will add more debug.



Matthew Tippett - matthew.tippett at sympatico.ca - (416) 435-4118
Technology Forum - http://www.technology-forum.org/
Commercial Open Source - http://www.commercialos.org/

More information about the jcifs mailing list