[jcifs] NtlmHttpFilter does not use multiple Domain Controllers. bug in getChallengeForDomain() ?

RMathe R.Mathe at ing-diba.de
Tue Feb 15 13:12:12 GMT 2005


Hi,

I use the NtlmHttpFilter of jcifs version 1.1.8 for Authentication. My 
configuration is

jcifs.smb.client.domain=MYDOMAIN
jcifs.netbios.wins=<list-of-wins-servers>
jcifs.http.loadBalance=false

This Domain has a list of valid Domain Controllers

If the first DC was used and then it gets unavailable, I get exceptions like

errorClass=2,errorCode=130,errorString=ERR_SSN_SRVC/Called name not present
	at jcifs.netbios.NbtSocket.connect(NbtSocket.java:121)
	at jcifs.netbios.NbtSocket.<init>(NbtSocket.java:68)
	at jcifs.smb.SmbTransport.run(SmbTransport.java:342)
	at java.lang.Thread.run(Thread.java:534)
java.io.IOException: Failed to establish session with MYDOMAIN<1B>/10.11.12.13
	at jcifs.smb.SmbTransport.run(SmbTransport.java:363)
	at java.lang.Thread.run(Thread.java:534)
jcifs.smb.SmbException: Timeout trying to open socket
java.io.IOException: Failed to establish session with MYDOMAIN<1B>/10.11.12.13
	at jcifs.smb.SmbTransport.run(SmbTransport.java:363)
	at java.lang.Thread.run(Thread.java:534)
	at jcifs.smb.SmbTransport.start(SmbTransport.java:315)
	at jcifs.smb.SmbTransport.negotiate0(SmbTransport.java:865)
	at jcifs.smb.SmbTransport.negotiate(SmbTransport.java:941)
	at jcifs.smb.SmbSession.getChallenge(SmbSession.java:161)
	at jcifs.smb.SmbSession.getChallenge(SmbSession.java:155)
	at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:130)

The filter does not use a second DC.

If I set loadBalance=true, there is a list of used DCs loaded, e.g.
MYDOMAIN<1C>/10.11.12.13;MYDOMAIN<1C>/10.11.12.14

but if the first DC goes down after using the second is not accessed and I get 
an exception too

there seems to be a bug in SmbSession.getChallengeForDomain() handling the 
variables starting_index, dc_list_index and dc_list_range

After an successful request dc_list_index is increased but if the next request 
with dc_list_index=1 and dc_list_range=1 is processed the second DC is not 
accessed because of a wrong logic:

starting_index = dc_list_index (set to 1)
if(dc_list_index == dc_list_range) dc_list_index = 0
incr_dc_list_range() (sets dc_list_range=2)
dc_list_index++ (set to 1)
while(dc_list_index != starting_index) (returns false)

Any suggestions to resolve the problem without changing the Library?

RMathe



More information about the jcifs mailing list