[jcifs] ServerEnum2 Problems on smb:// scan

Allen, Michael B (RSCH) Michael_B_Allen at ml.com
Mon Dec 2 11:10:03 EST 2002

> -----Original Message-----
> From:	Matthew Tippett [SMTP:matthew.tippett at sympatico.ca]
> Sent:	Sunday, December 01, 2002 6:59 PM
> To:	jcifs at lists.samba.org
> Subject:	Re: [jcifs] ServerEnum2 Problems on smb:// scan
> > 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.
	Are the test machines under your control? Perhaps one is returning a garbage
	domain name or is set to use some strange character encoding? This doesn't sound
	like a platform dependant issue. It is more likely that a particular machine or a
	particular alignment of machines is triggering the issue. For example, if the
	NetServerEnum2 that lists all domains was decoding the domain names improperly
	it could be the source of the corrupted domain name. Basically you need to find out
	where that garbage domain name is coming from ultimately. Is it being returned by
	one of the test machines or is it an atrifact of a bug in jCIFS?

> 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 :(
	That's a costly bandaid. Nothing more. I advise that you track down the real source
	of the problem.

> 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