[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.
>>jcifs.smb.SmbException:
>>GetServerEnum2Response[command=SMB_COM_TRANSACTION,received=true,errorCo
>>de=0x00000000,flags=0x0098,flags2=0x0001,tid=51202,pid=64459,uid=0,mid=2
>>59,wordCount=10,byteCount=9,totalParameterCount=8,totalDataCount=0,param
>>eterCount=8,parameterOffset=55,parameterDisplacement=0,dataCount=0,dataO
>>ffset=64,dataDisplacement=0,setupCount=0,pad=0,pad1=0,status=2320,conver
>>ter=0,entriesReturned=0,totalAvailableEntries=45]
>>
>>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.
Regards,
Matthew
--
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