[jcifs] Tests with 1.2.11b / Problems with DFS

Thomas Bley thomas.bley at simple-groupware.de
Wed Dec 6 18:28:00 GMT 2006


Hello,

Thanks for your mail. I tried this, but I think the problems come again 
if the dfs-link points again to a dfs-link.
The webdisk often uses files[i].listFiles(), so maybe it works when 
placing this workaround in the SmbFile Constructor.
But I don't know if this would break the performance ?

bye
Thomas


James Maupin wrote:
> Thomas,
>
> Not sure if someone answered you. I found two operations that work only on
> the 'actual' path (as compared to the dfs path): listFiles and opening an
> input stream.
>
> Try the following:
>
>        SmbFile file = new SmbFile( "smb://192.168.0.6/MyRoot/share1/Temp",
> ntlm );
>        if (file.getDFSPath != null) file = new SmbFile(file.getDFSPath());
>        SmbFile[] files = file.listFiles();
>        for( int i = 0; i < files.length; i++ ) {
>            System.out.print( " " + files[i].getName()+"\n" );
>        }
>
> Not sure if this by design?
>
> regards,
> James
>
> -------------------------------------
> James Maupin
> Business Development Engineer, Energy
>
> MetaCarta, Inc. ( www.metacarta.com )
> 1155 Dairy Ashford
> Suite 201
> Houston, TX 77079
>
> Tel: (832) 300-8800 USA
> Mob: (832) 746-6802 USA
> james.maupin at metacarta.com
>
> -----Original Message-----
> From: jcifs-bounces+james.maupin=metacarta.com at lists.samba.org
> [mailto:jcifs-bounces+james.maupin=metacarta.com at lists.samba.org]On
> Behalf Of Thomas Bley
> Sent: Thursday, November 30, 2006 9:39 PM
> To: jcifs at lists.samba.org
> Subject: [jcifs] Tests with 1.2.11b / Problems with DFS
>
>
> Hello,
>
> I've done some tests with the new 1.2.11b and found no problems with
> long/unicode share names and SID resolution / ACEs. It's really great! I
> tested WinXP SP2, W2k3 SP1 and Samba. As soon as I have some time I will
> test a NetApp machine.
>
> My current problem is a DFS test:
>
> I have two machines: 192.168.0.6 (w2k3) and 192.168.0.4 (winxp)
> \\192.168.0.6\MyRoot\share1 is a dfs share and points to \\192.168.0.4\temp
> \\192.168.0.6\Temp is a normal share
>
>
> When connecting to "share1" and then "Temp", the second one gets "access
> denied".
> When connecting to "Temp" alone, everything is ok, maybe you can help me ?
>
>
> Here is my code:
>
>        NtlmPasswordAuthentication ntlm = new
> NtlmPasswordAuthentication("","administrator","admin");
>
>        SmbFile file = new SmbFile( "smb://192.168.0.6/MyRoot/share1/",
> ntlm );
>        SmbFile[] files = file.listFiles();
>        for( int i = 0; i < files.length; i++ ) {
>            System.out.print( " " + files[i].getName()+"\n" );
>        }
>
>        System.out.println("\n__#second");
>        SmbFile file2 = new SmbFile( "smb://192.168.0.6/Temp/",ntlm );
>        SmbFile[] files2 = file2.listFiles();
>        for( int i = 0; i < files2.length; i++ ) {
>            System.out.print( " " + files2[i].getName() );
>        }
>
>
> The problem is the same for the old and the new dfs code in SmbFile.java
> new:
>                    dfsReferral = dr;
>                    request.path = getDfsUncPath0();
> old:
>                    dfsReferral = dr;
>                    unc = dfsReferral.nodepath + unc.substring(
> dfsReferral.path.length() );
>                       if( request.path.charAt( request.path.length() -
> 1 ) == '\\' ) {
>                           request.path = unc + '\\';
>                       } else {
>                           request.path = unc;
>                    }
>
>
> Setting a long sleep gives a successful request of "Temp":
>   listfiles: MyRoot/share1
>   Thread.sleep(60000);
>   listfiles: Temp
>   



More information about the jcifs mailing list