[jcifs] DFS not working with root links

Michael B Allen ioplex at gmail.com
Mon Feb 9 16:12:17 GMT 2009

On Mon, Feb 9, 2009 at 9:54 AM, Yogesh Shukla <yshukla at lexmark.com> wrote:
> I am new to cifs and DFS so it could be that I am not doing something right.
> Here is what I see: I have two shares
> share1: \\a.b.c\rootShare that points to \\x.y.z\rootShare1
> share2: \\d.e.f\docShare\myDoc that points to \\p.q.r\docShare1\myDoc1
> Using jcifs I can access DFS share2 i.e. if I try to access
> \\d.e.f\docShare\myDoc it redirects requests to \\p.q.r\docShare1\myDoc1
> But trying the same thing with share1 fails i.e. \\a.b.c\rootShare does not
> redirect requests to \\x.y.z\rootShare1 . I get a NT_STATUS_BAD_NETWORK_NAME
> exception. However if I try to do this from a windows explorer or from smbclient
> they are able to redirect requests without any issues. The only difference
> between the two set-ups is that in share1 the dfs root itself points to a
> different share while in share2 a dfs link under the root points to a different
> share.
> I have tried this out with different jcifs versions including 1.3.3 and all
> produce the same result.
> I believe there is nothing different that my app needs to do to access a DFS
> share. It should be transparent to the app whether it is talking to a simple
> windows share or a DFS share.
> I am unable to provide network sniffs due to privacy\confidentiality issues. If
> any additional information is needed I can try and provide that.


If your analysis is correct it sounds like a corner case that JCIFS
does not handle properly. If a Windows client can do it, JCIFS should
be able to do it too (unless perhaps it involves offline shares or

Is a.b.c a domain name or hostname? Is \\a.b.c\rootShare a
domain-based or stand-alone DFS root?

Unfortunately the only practical way to diagnose this issue is with
captures. Then I can replicate the issue here and fix it properly
without getting into a game of Whac-A-Mole. You know that only I would
look at the captures? Perhaps you can replicate the issue in a test
environment and then provide captures?


Michael B Allen
Java Active Directory Integration

More information about the jcifs mailing list