[jcifs] Problems with resolution of DFS-Links

Michael B Allen mba2000 at ioplex.com
Wed Apr 27 21:54:19 GMT 2005

Marro, Donato said:
> Hello,
> in a directory within a network-share I have a DFS-Link to a directory
> on a different network-share, like the following:
> DFS-share: \\a\dfs
> DFS-Link to another share: \\a\dfs\linkedDirectory (points to \\b\tmp)
> The access to \\a\dfs works normal. But when trying to list the files of
> \\a\dfs\linkedDirectory, I get the follwing Exception:
> DfsReferral[path=\linkedDirectory,node=\b\tmp,server=b,share=tmp,nodepath=,r
> esolveHashes=true]

DFS does not work transparently with NTLM HTTP Authentication because the
negotiated challenge is specific to the target server. So when a referral
occurs the current NPA is no longer valid for the new target.

The only way to successfully access the new resource is to build a new NPA
which requires renegotiating NTLM HTTP Authentication.

So in this scenario jcifs keeps track of wheather or not "externally
supplied" hashs were used and marks the referral to "resolveHashs". When
the send() code sees this it simply throws the DfsReferral exception all
the way out of whatever method was called. The web application can then
catch it and issue a redirect (which is the conceptual equivalent of a DFS
referral). See the jcifs/http/NetworkExplorer.java Servlet as an example.


More information about the jcifs mailing list