[jcifs] SmbFile.mkdirs() and DFS

Sameer Mehta Sameer_Mehta at symantec.com
Thu Jun 3 11:16:18 MDT 2010


Hello All, 


Anyone had a chance to review this ? If so, any thoughts ? i.e. yes, it
is a known issue ? Are developers using SmbFile.mkdirs with DFS to
create nested directories ? Any feedback is much appreciated.

thanks,
~sameer



-----Original Message-----
From: jcifs-bounces at lists.samba.org
[mailto:jcifs-bounces at lists.samba.org] On Behalf Of sameermehta
Sent: Thursday, May 27, 2010 7:10 PM
To: jcifs at lists.samba.org
Subject: [jcifs] SmbFile.mkdirs() and DFS


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\DF
S\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\DF
S\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.h
tml
Sent from the Samba - jcifs mailing list archive at Nabble.com.



More information about the jCIFS mailing list