[jcifs] Re: jCIFS change

Michael B Allen mba2000 at ioplex.com
Sun Jul 13 19:35:40 EST 2003


> Michael,
>
> Firstly I'd like to thank you for your work on jCIFS.  I'm still
> experimenting with it, but it looks like the ideal solution for using NTLM
> authentication in our next JSP intranet app.  One slight issue I have
> noticed is that the jcifs.http.domainController property can only take a
> single hostname.  This would provide a single point of failure in our app,
> which is unacceptable to our users. To get around this issue I decided to
> change jCIFS to accept the string "localhost" in this property.  This will
> delegate the authentication to the local server (with is a win2k box in
> our
> case) and use the full list of backup domain controllers.

Just set jcifs.netbios.wins and use the domain name. Although there is
also a "single point of failure" with this method as well; you can only
specify one WINS server so if that goes down you're toast. That will need
to be fixed but it's non-trivial so I'm leaving it for the next major
release.

>  To make this
> change I added the following lines to the UniAddress.java file's getByName
> method:
>
>     public static UniAddress getByName( String hostname,
>                                         boolean
> possibleNTDomainOrWorkgroup
> )
>                                         throws UnknownHostException {
>         Object addr;
>         int i;
>
>         if( hostname == null || hostname.length() == 0 ) {
>             throw new UnknownHostException();
>         }
>
>         // START OF ADDED CODE
>         if( "localhost".equalsIgnoreCase( hostname )) {
>           return new UniAddress( NbtAddress.getLocalHost() );
>         }
>         // END OF ADDED CODE
>
>         if( isDotQuadIP( hostname )) {
>             return new UniAddress( NbtAddress.getByName( hostname ));
>         }
>
> Please add this change to the next release if you think it is useful.
>
> Regards,
> Dave




More information about the jcifs mailing list