[jcifs] DFS and NetworkExplorer

Mike Streeton mike.streeton at ardentia.co.uk
Fri Jun 30 11:28:08 GMT 2006

I have finally got it working. We have two parts of the app that are
NetworkExplorer like. One is a directory browser and the redirect that
is generated was generating the wrong url (this is based on the jcifs
code) the fix was to construct the redirect url:

		} catch (DfsReferral dr) {
			response.sendRedirect(request.getContextPath() +
request.getServletPath() + "/"
					+ dr.server + "/" + dr.share +

We do not need any other path/query string information.

The other part of the app allows users to download files. This proved to
be more of a struggle, we did not get the dfs redirect if we went
straight to the file. The solution was to walk the path starting at the
server until we either got to the file (in which case we sent it back)
or got a dfs referral in which case we construct the redirect as above
but tagging on the rest of the path. This worked okay the first time you
did it, but if you tried again without restarting it hung and got into a
401; 401; 302 loop. The fix for this was to cache the dfs referral and
redirect straight away when we spot it. This is also slightly faster.
The only issue now is the speed to do the handshake that take between
30s-60s. The NTLM HTTP filter does it in about 2s. Thanks for all the


www.ardentia.com the home of NetSearch
-----Original Message-----
From: Michael B Allen [mailto:mba2000 at ioplex.com] 
Sent: 28 June 2006 18:11
To: Mike Streeton
Cc: jcifs at lists.samba.org
Subject: Re: [jcifs] DFS and NetworkExplorer

On Wed, 28 Jun 2006 17:11:51 +0100
"Mike Streeton" <mike.streeton at ardentia.co.uk> wrote:

> Does Network Explorer work with windows DFS  file systems, we are
> to access one, but keep getting unknown host, what was confusing us
> the virtual dfs server is the same name as the domain. So it now
> to be accessing the right virtual machine, but not allowing access,
> ideas?

We have seen problems with DFS in general. Traditionally DFS works by
checking a flag when connecting to a drive and then based on that query
the server for a referral. But there seems to be a mode of operation
Windows clients obtain information about DFS through other
channels. It looks like smbclient deals with this problem by simply
performing the referral before even trying to connect to drives. Try
smbclient to verify that it's just a protocol error.


Michael B Allen
PHP Extension for SSO w/ Windows Group Authorization

More information about the jcifs mailing list