[jcifs] jcifs-1.2.12 and DFS

James Maupin james.maupin at metacarta.com
Mon Jan 8 02:42:42 GMT 2007


Michael,

With jcifs1.2.13b2, getDfsPath() does not give the
StringIndexOutOfBoundsException, however, it includes an extra slash at the
end?

titan:/home/metacarta/sdc# ./run GetDfsPath
"smb://Administrator:m3tacarta@testserver.testdomain.local/Current Test
Folder/DFS/"
queryPath: \DFS
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
e=skyrockets,nodepath=,resolveHashes=false]
The dfs path for "DFS/" is smb://Testserver02/skyrockets//

Also, ListFiles.java still gives the same output.

titan:/home/metacarta/sdc# ./run ListFiles
"smb://Administrator:apassword@testserver.testdomain.local/Current Test
Folder/DFS/"
doFindFirstNext: \DFS\
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
e=skyrockets,nodepath=,resolveHashes=false]
 021303 MGS Presentation.ppt, length is: 1797632
 040419AcquisitionPerformance.ppt, length is: 832512
< file names removed >
 190/, length is: 0
 192/, length is: 0
 Thumbs.db, length is: 5632

55 files in 6171ms

titan:/home/metacarta/sdc# ./run ListFiles
"smb://Administrator:apassword@testserver.testdomain.local/Current Test
Folder/DFS/192/"
doFindFirstNext: \DFS\192\
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
e=skyrockets,nodepath=,resolveHashes=false]
 192/, length is: 0

1 files in 6164ms

titan:/home/metacarta/sdc# ./run ListFiles
"smb://Administrator:apassword@testserver.testdomain.local/Current Test
Folder/DFS/192/192/"
doFindFirstNext: \DFS\192\192\
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
e=skyrockets,nodepath=,resolveHashes=false]
 192news.html, length is: 10952
 192noticep.html, length is: 13717

2 files in 6161ms

<< NOTE: /DFS/192/192/ does not exist >>

BTW, ListACL.java appears to behave correctly; that is, /DFS and /DFS/192
return acls and /DFS/192/192 throws SmbException: the system cannot find the
file specified. Also, SlowRead.java ran as expected on
/DFS/192/192noticep.html.

Let me know if I can help in any way. I can post the low level messaging if
you would like (-Djcifs.util.loglevel=5). I know you're busy and appreciate
the help.

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<dot>maupin<at>metacarta<dot>com

-----Original Message-----
From: Michael B Allen [mailto:mba2000 at ioplex.com]
Sent: Sunday, January 07, 2007 7:20 PM
To: James Maupin
Cc: jcifs at lists.samba.org; karl.wright at metacarta.com; Thomas Bley
Subject: Re: [jcifs] jcifs-1.2.12 and DFS


James,

Did you try 1.2.13b2? That has some DFS fixes (one significant one
that I think covers the index out of bounds exception). Everyone else
(e.g. Thomas) is welcome to try it as well. It's in the download area.

Mike

On Sun, 7 Jan 2007 19:00:44 -0600
"James Maupin" <james.maupin at metacarta.com> wrote:

> Michael and others,
>
> jcifs-1.2.12
>
> -Djcifs.util.loglevel=3
>
> DFS test environment
>
> 2 machines:
>
> testserver.testdomain.local
> testserver02.testdomain.local
>
> Smb/Cifs share is:
>
> \\testserver.testdomain.local\Current Test Folder\
>
> DFS root is:
>
> \\testserver.testdomain.local\Current Test Folder\DFS\
>
> DFS root points to:
>
> \\testserver02.testdomain.local\skyrockets\
>
> Some tests: Note: ListFiles is /examples/ListFiles.java modified with
> length().
>
> titan:/home/metacarta/sdc# ./run ListFiles
> "smb://Administrator:apassword@testserver.testdomain.local/Current Test
> Folder/DFS/"
> doFindFirstNext: \DFS\
>
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
> e=skyrockets,n odepath=,resolveHashes=false]
> in doFindFirst: resp is:
>
Trans2FindNext2Response[command=SMB_COM_TRANSACTION2,received=false,errorCod
> e=0,flags=0x00
>
98,flags2=0xD003,signSeq=0,tid=2048,pid=40574,uid=2048,mid=3,wordCount=10,by
> teCount=2697,t
>
otalParameterCount=10,totalDataCount=6984,parameterCount=0,parameterOffset=5
> 6,parameterDis
>
placement=10,dataCount=2696,dataOffset=56,dataDisplacement=4288,setupCount=0
> ,pad=0,pad1=1,
>
sid=2048,searchCount=57,isEndOfSearch=true,eaErrorOffset=0,lastNameOffset=68
> 72,lastName=Th umbs.db]
>  021303 MGS Presentation.ppt, length is: 1797632
>  040419AcquisitionPerformance.ppt, length is: 832512
> < file names removed for brevity >
>  190/, length is: 0
>  192/, length is: 0
>  Thumbs.db, length is: 5632
>
> 55 files in 6171ms
>
> titan:/home/metacarta/sdc# ./run ListFiles
> "smb://Administrator:apassword@testserver.testdomain.local/Current Test
> Folder/DFS/192/"
> doFindFirstNext: \DFS\192\
>
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
> e=skyrockets,n odepath=,resolveHashes=false]
> in doFindFirst: resp is:
>
Trans2FindNext2Response[command=SMB_COM_TRANSACTION2,received=false,errorCod
> e=0,flags=0x00
>
98,flags2=0xD003,signSeq=0,tid=2048,pid=45535,uid=2048,mid=3,wordCount=10,by
> teCount=113,to
>
talParameterCount=10,totalDataCount=100,parameterCount=10,parameterOffset=56
> ,parameterDisp
>
lacement=0,dataCount=100,dataOffset=68,dataDisplacement=0,setupCount=0,pad=1
> ,pad1=2,sid=20
>
48,searchCount=1,isEndOfSearch=true,eaErrorOffset=0,lastNameOffset=0,lastNam
> e=192]
>  192/, length is: 0
>
> 1 files in 6160ms
>
> << NOTE: /DFS/192/192/ does not exist >>
>
> titan:/home/metacarta/sdc# ./run ListFiles
> "smb://Administrator:apassword@testserver.testdomain.local/Current Test
> Folder/DFS/192/192/"
> doFindFirstNext: \DFS\192\192\
>
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
> e=skyrockets,n odepath=,resolveHashes=false]
> in doFindFirst: resp is:
>
Trans2FindNext2Response[command=SMB_COM_TRANSACTION2,received=false,errorCod
> e=0,flags=0x00
>
98,flags2=0xD003,signSeq=0,tid=2048,pid=33887,uid=2048,mid=3,wordCount=10,by
> teCount=265,to
>
talParameterCount=10,totalDataCount=252,parameterCount=10,parameterOffset=56
> ,parameterDisp
>
lacement=0,dataCount=252,dataOffset=68,dataDisplacement=0,setupCount=0,pad=1
> ,pad1=2,sid=20
>
48,searchCount=2,isEndOfSearch=true,eaErrorOffset=0,lastNameOffset=124,lastN
> ame=192noticep .html]
>  192news.html, length is: 10952
>  192noticep.html, length is: 13717
>
> 2 files in 6164ms
>
> --------------------------------------------
>
> GetDfsPath.java is:
>
>         SmbFile f = new SmbFile( argv[0] );
>         System.out.println( "The dfs path for \"" + f.getName() + "\" is "
+
> f.
> getDfsPath() );
>
> titan:/home/metacarta/sdc# ./run GetDfsPath
> "smb://Administrator:apassword@testserver.testdomain.local/Current Test
> Folder/DFS/"
> queryPath: \DFS
>
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
> e=skyrockets,n odepath=,resolveHashes=false]
> Exception in thread "main" java.lang.StringIndexOutOfBoundsException:
String
> index out of  range: -3
>         at java.lang.String.substring(String.java:1444)
>         at java.lang.String.substring(String.java:1411)
>         at jcifs.smb.SmbFile.getDfsUncPath0(SmbFile.java:1375)
>         at jcifs.smb.SmbFile.getDfsPath(SmbFile.java:1396)
>         at GetDfsPath.main(GetDfsPath.java:8)
>
> titan:/home/metacarta/sdc# ./run GetDfsPath
> "smb://Administrator:apassword@testserver.testdomain.local/Current Test
> Folder/DFS/192/"
> queryPath: \DFS\192
>
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
> e=skyrockets,n odepath=,resolveHashes=false]
> The dfs path for "192/" is smb://Testserver02/skyrockets/
>
>
> titan:/home/metacarta/sdc# ./run GetDfsPath
> "smb://Administrator:apassword@testserver.testdomain.local/Current Test
> Folder/DFS/192/192/"
> queryPath: \DFS\192\192
>
DfsReferral[path=\DFS,node=\Testserver02\skyrockets,server=Testserver02,shar
> e=skyrockets,n odepath=,resolveHashes=false]
> The dfs path for "192/" is smb://Testserver02/skyrockets/192
>
> < NOTE: /DFS/192/192/ does not exist >>
>
> Any ideas?
>
> regards,
> James
>
> -------------------------------------
> James Maupin
> Business Development Engineer, Energy
>
> MetaCarta, Inc. ( www<dot>metacarta<dot>com )
> 1155 Dairy Ashford
> Suite 201
> Houston, TX 77079
>
> Tel: (832) 300-8800 USA
> Mob: (832) 746-6802 USA
> james<dot>maupin<at>metacarta<dot>com
>


--
Michael B Allen
PHP Active Directory SSO
http://www.ioplex.com/



More information about the jcifs mailing list