[jcifs] (no subject)
Christopher R. Hertel
crh at ubiqx.mn.org
Thu Oct 23 12:39:10 EST 2003
On Wed, Oct 22, 2003 at 09:53:27PM -0400, Michael B Allen wrote:
> >> unfortunately, also the farest controllers are
> >> chosen for authentication. if this happens, the chance for exceptions
> >> (smb
> >> timeout) is rising.
> >> if we use a single domain controller for the jcifs.http.domainController
> >> property, everything works fine. but if this single domain controller is
> >> not available, our application is in deep trouble ...
> >> is there a chance to give a list of domain controllers for the property?
> > No. But I think this is clearly an important feature so it will need to
> <snip previous idea>
> Actually there is another *very easy* solution to this problem. The
> NetBIOS 0x1C group name lookup returns a list of domain controllers. As it
> is we just read the first and return that.
Note that the first is always the PDC. The rest are BDCs. I *think* that
the BDC entries are ordered with the most recent refresh at the top of the
> I have modified the
> NameServicePacket.readResourceRecordWireFormat() method to decode more of
> the list depending on the value of a static 'addrIndex' member. IOW, if a
> NetBIOS name lookup returns more than one name, the code will pick the
> next address in the list or reset addrIndex to 0 if it reached the end.
Um... "if a NetBIOS name lookcup returns more than one" IP address.
If I read this correctly, the method will, if called repeatedly, enumerate
the IPs in the list, yes? Checking addrIndex will let you know when
you're at the end of the list. Have I got that straight.
> Now I just have to modify the NtlmHttpFilter to do an
> NbtAddress.getByName( domain, 0x1C, null ) lookup instead of the usual
> 0x20 lookup.
If you do a broadcast query, you will only get local LAN DCs. That's
okay. It's just that you'll get zero or more packets instead of a single
response (with multiple IPs) from an NBNS.
> The effect will be that a different domain controller will be
> returned with each NTLM http negotiation and sessions will be distributed
> evenly across them. The change is about 5 lines of code so unless this
> trips up Chris' NetBIOS sensors I think 0.7.15 is coming up ...
Only the caveat about broadcast vs. NBNS queries. As long as there's a
way to specifically retrieve the first entry if there are multiple
entries, I think this'll work.
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/ -)----- Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/ -)----- ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/ -)----- crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/ -)----- crh at ubiqx.org
More information about the jcifs