[jcifs] SmbSession.matches

Michael B. Allen miallen at eskimo.com
Wed Aug 21 05:01:03 EST 2002


On Tue, 20 Aug 2002 16:31:30 +0200 (MEST)
Manfred Huberbauer <made at gmx.at> wrote:

> Hi
> 
> I tested your Library on Tomcat for an Internet-Authentification with
> Netscape or Konqueror. Tomcat often returned a NullPointerException and pointed at
> the function SmbSession.matches().
> In this function you do some tests, but I think, you forgot to test, if all
> of them are null. You just test, if one of two is null. Therefore I added a
> line, which consideres that.
> My matches lookes like this:
> 
> boolean matches( NtlmPasswordAuthentication auth, byte[] challenge ) {
>         return (auth.domain != null && auth.username != null) &&

Yes,  sorry.  I  though I fixed this. This particular issue is fixed in the
version I'm about to relase. You do know that NTLM HTTP Authentication does
not work with Netscape and Konq right? Also, when you say "Internet" do you
mean  THE  Internet?  If so, your application might not be as robust as one
that just used a database like MySQL. 

>                (this.auth.domain == null || auth.domain.equals(
> this.auth.domain )) &&
>                (this.auth.username == null || auth.username.equals(
> this.auth.username )) &&
>                this.auth.hashEquals( auth.getUnicodeHash( challenge ),
> challenge );
> }
> 
> It doesn't bother if this.auth.domain or this.auth.username are null, but it
> works.
> 
> Yours
> Manfred Madritsch
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
> 


-- 
A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and more importantly to tasks that have not
yet been conceived. 



More information about the jcifs mailing list