[jcifs] 1.2.12 heads-up about SID.toString() / dfs / signing
Thomas Bley
thomas.bley at simple-groupware.de
Fri Dec 15 07:51:54 GMT 2006
Hello,
I found the problem with dfs and win2k3:
disabling signing makes the second dfs-request resolving correctly
(setting: local security settings / local policies / security options /
microsoft network server: "digitally sign communications (always)" from
enabled to disabled), but I don't understand why signing works on the
first request and fails on the second ?
using 1.2.11 and win2k3 sp1 as dfs-server:
- dfs-links pointing to dfs-links don't work (wrong directory content)
using 1.2.11 and Samba 3.0.12 as dfs-server instead of w2k3:
- dfs-links pointing to dfs-links don't work (wrong directory content)
I made the same test with 1.2.12b and Samba 3.0.12 as dfs-server instead
of w2k3:
- I don't get access denied (no signing)
- dfs-link pointing to a dfs-link: It works when I define the
dfs-symlink as msdfs:192.168.0.2\dfs\share1\, doing it with
msdfs:192.168.0.2\dfs\share1 gives me an "invalid handle" exception.
When I change the code to this one, it works correctly with Samba and
win2k3:
String getDfsUncPath0() throws SmbException {
getUncPath0();
if( dfsReferral == null ) {
return null;
}
String dunc = dfsReferral.nodepath;
// avoid StringIndexOutOfBoundsException
if (unc.length() >= dfsReferral.path.length()) dunc +=
unc.substring( dfsReferral.path.length() );
if (dunc.length()>0 && dunc.charAt(dunc.length()-1)!='\\') dunc
+= "\\";
return "".equals( dunc ) ? "\\" : dunc;
}
/**
* If the path of this <code>SmbFile</code> falls within a DFS volume,
* this method will return the referral path to which it maps. Otherwise
* <code>null</code> is returned.
*/
public String getDfsPath() throws SmbException {
connect0();
if( tree.inDfs ) {
exists();
}
if( dfsReferral == null ) {
return null;
}
String path = "smb:/" + dfsReferral.node + getDfsUncPath0();
path = path.replace( '\\', '/' );
// only add slash if not already present
if (isDirectory() && path.charAt(path.length()-1)!='/') {
path += '/';
}
return path;
}
bye
Thomas
Michael B Allen wrote:
> Hi Thomas,
>
> Do all of these tests work flawlessly with 1.2.11?
>
> Mike
>
> On Fri, 15 Dec 2006 06:58:57 +0100
> Thomas Bley <thomas.bley at simple-groupware.de> wrote:
>
>
>> Hello,
>>
>> I did a short check with 1.2.12b and dfs with a W2k3 Sp1 / WinXP:
>>
>> - calling getDfsPath() throws java.lang.StringIndexOutOfBoundsException
>> in getDfsUncPath0:
>> I think the problem is here when unc is \ and dfsReferral.path is for
>> example \vdir4: unc.substring( dfsReferral.path.length() )
>>
>> - Dfs-links pointing to Dfs-links give the wrong directory content
>>
>> - Dfs-links pointing to another server give access denied when an
>> accessing a second time:
>>
>> I don't know if this is a jCIFS issue, the Ethereal dump looks a bit
>> strange, since the second Find_First2 gives "Access_Denied" instead of
>> "Path_not_covered", maybe a problem with the w2k3 server ? (see the
>> dumps, esp. dfs1.dump)
>>
>>
>> The structure:
>> - //192.168.0.6/MyRoot/share1/ points to //192.168.0.4/Temp/
>> - //192.168.0.6/MyRoot/vdir4/ points to //192.168.0.6/MyRoot/
>> - MyRoot is the dfs-root, 192.168.0.6 is the win2k3 sp1 machine,
>> 192.168.0.4 is a WinXP sp2
>>
>> The code:
>> public static NtlmPasswordAuthentication ntlm = new
>> NtlmPasswordAuthentication("","administrator","admin");
>>
>> public static void queryPath(String path) throws Exception {
>> System.out.println("Query url "+path);
>> SmbFile file0 = new SmbFile( path, ntlm );
>> SmbFile[] files0 = file0.listFiles();
>> for( int i = 0; i < files0.length; i++ ) {
>> System.out.print( " " + files0[i].getName()+"#\n" );
>> }
>> System.out.println("__end__");
>> }
>>
>> public static void main( String[] argv ) throws Exception {
>> queryPath("smb://192.168.0.6/MyRoot/share1/");
>> queryPath("smb://192.168.0.6/MyRoot/vdir4/");
>> }
>>
More information about the jcifs
mailing list