[jcifs] NTLM Filter error message
Michael B Allen
mba2000 at ioplex.com
Mon Jan 10 23:56:24 GMT 2005
Jeroen ter Voorde said:
> Hi again,
>
> I did some debugging and i think the problem is in the dc_list expire
> code in SmbSession.getChallengeForDomain(). It seems the following is
> happening:
>
> - I do single sign-on. dc_list var is set.
> - I disable the network interface.
> - I do single sign-on again dc_list[0] becomes null (bad dc).
> - dc_list[0] stays null until the dc_list expires.
Well, if you only have 1 DC and it's not responding then you're gonna have
a problem whatever you do.
> I get another similar problem by doing the first sso login when the
> network interface is down.
> In this case dc_list stays null but dc_list_expiration is set causing
> NPE's on this line:
> NbtAddress addr = dc_list[dc_list_index]; (SmbSession.java: line 109)
> until the dc_list expires.
>
> I think the dc_list should always be refreshed if dc_list == null or all
> dc_list entries are null.
Ok, so if getAllByName returns 'null' then not only do we not wipe out the
old dc_list but we reset dc_list_expiration. Although I don't think it's a
good idea to just set dc_list_expiration to 0. We should just set it to
something really short but a big enough pause to prevent jcifs from
flipping out trying to get the DC list.
Perhaps something like:
95 NbtAddress[] new_dc_list = NbtAddress.getAllByName( DOMAIN,
0x1C, null, null );
96 if( new_dc_list == null) {
97 dc_list_expiration = System.currentTimeMillis() + 10000;
/* 10sec */
98 throw new UnknownHostException( DOMAIN );
99 } else if( new_dc_list.length >= dc_list_range ) {
100 dc_list = new_dc_list;
101 }
I'll look at this for the next minor rev.
Thanks,
Mike
More information about the jcifs
mailing list