[jcifs] SmbFile.mkdirs() and DFS

sameermehta sameer_mehta at symantec.com
Thu May 27 20:10:06 MDT 2010

I'm using the latest jcifs library i.e. 1.3.14 and noticed that
SmbFile.mkdirs() fails for DFS file paths i.e. file path must include nested
directories that don't exist, however, the same works fine when I replace
DFS links with Windows file share (result of a DFS referral). For e.g.
consider the following DFS file path. 

27, 10 5-07-45p\dar.engdlp.symantec.com\2k8dfs_namespace1\2k8dfs_folder\test

In the above e.g. part of the file path exists and rest does not hence I am
using mkdirs(). 

exists, while DFS\May 27, 10
5-07-45p\dar.engdlp.symantec.com\2k8dfs_namespace1\2k8dfs_folder\test does

While using mkdirs() function with DFS file path and looking at the tcpdump
I see that jcifs client issues a create directory smb request (filename:
\remediation\DFS\May 27, 10 5-07-45p) and succeeds (NT_STATUS for this
request is set to STATUS_SUCCESS). However, when it tries to create a child
directory within  May 27, 10 5-07-45p (filename:\remediation\DFS\May 27, 10
5-07-45p\dar.engdlp.symantec.com), the request fails with error

Having said this -- eventually i.e. executing the same program more than
once, leads to successful parent and child directory creation. This leads me
to believe that SmbFile.mkdirs is not handling DFS file paths correctly
especially when path includes nested directories that don't exist. The same
program works fine if the path is replaced with DFS referral i.e. in my case

27, 10
 \\2K8DFS-1\2k8dfs_folder\remediation\DFS\May 27, 10

Attaching a test program which reproduces this issue -- 
OpenSmbFile.java.txt . 


View this message in context: http://old.nabble.com/SmbFile.mkdirs%28%29-and-DFS-tp28702003p28702003.html
Sent from the Samba - jcifs mailing list archive at Nabble.com.

More information about the jCIFS mailing list