[jcifs] Re: Accessing protected share from Servlet
David Webster
dave_web at yahoo.com
Tue Jan 30 21:28:42 GMT 2007
Michael B Allen <mba2000 <at> ioplex.com> writes:
>
> On Tue, 30 Jan 2007 20:05:39 +0000 (UTC)
> David Webster <dave_web <at> yahoo.com> wrote:
>
> > jcifs.smb.SmbAuthException: Invalid access to memory location.
>
> This is the heart of the problem right here. This cryptic message is an
> error artifically induced within the client code to indicate to the user
> that the authentication challenge is not correct for the target server.
>
> The NTLM protocol works as follows. The client asks the server for a
> "challenge" which is just 8 bytes of random data. The challenge and
> the password are munged together to produce password hashes. Thus the
> password hashes are specific to the server being authenticated with.
>
> The problem you're seeing occurs because you are authenticating with
> one server (e.g. the domain controller) and then trying to use the old
> challenge to authenitcate with a different server.
>
> The bottom line is that you need to get NetworkExplorer working. Change
> it a little and verify that it still works. Rinse and repeat.
>
> Mike
>
Frist off thanks for your help so far!
I dropped in NetworkExplorer and tried to run it with the following url
http://myserver/networkexplorerpattern///fileserver/fileshare/. I printed out
the path the the SMBFile that appears to be created properly:
file.getPath() prints smb://fileserver/fileshare/
Is passes file.isDirectory() and when it goes into doDirectory it fails on
dir.listFiles() with the following exception:
jcifs.smb.SmbException: The network name cannot be found.
at jcifs.smb.SmbTransport.checkStatus
(Ljcifs.smb.ServerMessageBlock;Ljcifs.smb.ServerMessageBlock;)V
(SmbTransport.java:514)
at jcifs.smb.SmbTransport.send
(Ljcifs.smb.ServerMessageBlock;Ljcifs.smb.ServerMessageBlock;)V
(SmbTransport.java:614)
at jcifs.smb.SmbSession.send
(Ljcifs.smb.ServerMessageBlock;Ljcifs.smb.ServerMessageBlock;)V
(SmbSession.java:239)
at jcifs.smb.SmbTree.treeConnect
(Ljcifs.smb.ServerMessageBlock;Ljcifs.smb.ServerMessageBlock;)V
(SmbTree.java:154)
at jcifs.smb.SmbFile.connect()V(SmbFile.java:798)
at jcifs.smb.SmbFile.connect0()V(SmbFile.java:768)
at jcifs.smb.SmbFile.doNetEnum
(Ljava.util.ArrayList;ZLjava.lang.String;ILjcifs.smb.SmbFilenameFilter;Ljcifs.s
mb.SmbFileFilter;)V(SmbFile.java:1710)
at jcifs.smb.SmbFile.listFiles
(Ljava.lang.String;ILjcifs.smb.SmbFilenameFilter;Ljcifs.smb.SmbFileFilter;)
[Ljcifs.smb.SmbFile;(SmbFile.java:1625)
at jcifs.smb.SmbFile.listFiles()[Ljcifs.smb.SmbFile;(SmbFile.java:1511)
fileserver pings fine from the server and client. Placing the path into
windows explorer replacing the "//" with "\\" and the share opens.
More information about the jcifs
mailing list