[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. 

\\dar.engdlp.symantec.com\2k8dfs_namespace1\2k8dfs_folder\remediation\DFS\May
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(). 

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

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
STATUS_OBJECT_PATH_NOT_FOUND. 

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
replace 

\\dar.engdlp.symantec.com\2k8dfs_namespace1\2k8dfs_folder\remediation\DFS\May
27, 10
5-07-45p\dar.engdlp.symantec.com\2k8dfs_namespace1\2k8dfs_folder\test, 
with
 \\2K8DFS-1\2k8dfs_folder\remediation\DFS\May 27, 10
5-07-45p\dar.engdlp.symantec.com\2k8dfs_namespace1\2k8dfs_folder\test. 

Attaching a test program which reproduces this issue -- 
http://old.nabble.com/file/p28702003/OpenSmbFile.java.txt
OpenSmbFile.java.txt . 


thanks,
~sameer





 
-- 
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