[jcifs] Problems with getSecurity
Juan Gregorio de las Heras
juangre at gmail.com
Mon Apr 16 17:59:04 GMT 2007
I'm trying the feature of SID resolution in version 1.2.13. I use the following
code (extract):
SmbFile file = null;
try {
file = new SmbFile ("smb://user:pass@server/path/file");
} catch ( MalformedURLException e ) {
System.out.println (e.getMessage ());
return;
}
System.out.println ("Name = " + file.getName ());
System.out.println ("Path = " + file.getUncPath () );
try {
System.out.println ("Size = " + file.length ());
System.out.println ("Cr. Date = " + file.createTime ());
System.out.println ("Mod. Date = " + file.lastModified ());
ACE[] acl = file.getSecurity ( true );
for (int i=0; i<acl.length; i++) {
System.out.println("ACL = " + acl[i].toString ());
System.out.println("ACL Name = " + acl[i].getSID ()
.toDisplayString ());
System.out.println("ACL Name = " + acl[i].getSID ()
.getAccountName ());
}
} catch ( SmbException e ) {
System.out.println(e.getMessage());
return;
} catch ( IOException e ) {
System.out.println(e.getMessage());
return;
}
When printing the ACL I obtain:
jcifs.smb.SmbException: The system cannot find the file specified.
at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:514)
at jcifs.smb.SmbTransport.send(SmbTransport.java:614)
at jcifs.smb.SmbSession.send(SmbSession.java:239)
at jcifs.smb.SmbTree.send(SmbTree.java:109)
at jcifs.smb.SmbFile.send(SmbFile.java:694)
at jcifs.smb.SmbFile.open0(SmbFile.java:834)
at jcifs.smb.SmbFile.open(SmbFile.java:852)
at jcifs.smb.TransactNamedPipeOutputStream.write(
TransactNamedPipeOutputStream.java:59)
at jcifs.dcerpc.DcerpcPipeHandle.doSendFragment(
DcerpcPipeHandle.java:50)
at jcifs.dcerpc.DcerpcHandle.sendrecv(DcerpcHandle.java:161)
at jcifs.dcerpc.DcerpcHandle.sendrecv(DcerpcHandle.java:128)
at jcifs.dcerpc.msrpc.LsaPolicyHandle.<init>(LsaPolicyHandle.java:32)
at jcifs.smb.SID.resolveSids0(SID.java:114)
at jcifs.smb.SID.resolveSids(SID.java:157)
at jcifs.smb.SmbFile.processAces(SmbFile.java:2626)
at jcifs.smb.SmbFile.getSecurity(SmbFile.java:2660)
at edu.ub.ci.sis.smb.JCIFS.testJCIFS(JCIFS.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.
JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.
TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.
RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.
RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.
RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.
RemoteTestRunner.main(RemoteTestRunner.java:196)
at de.uka.ipd.coverage.plugin.remote.
CoverageRemoteTestRunner.run(CoverageRemoteTestRunner.java:71)
at de.uka.ipd.coverage.plugin.remote.
CoverageRemoteTestRunner.<init>(CoverageRemoteTestRunner.java:37)
at sun.reflect.NativeConstructorAccessorImpl.
newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.
newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.
newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
de.uka.ipd.coverage.plugin.remote.
CoverageRemoteTestRunner.main(CoverageRemoteTestRunner.java:48)
Does any one kwnow what's the matter? what I am doing wrong?
I'm working in Ubuntu Linux 2.6.17-11, Java 1.5.0_10-b03
Thank you in advance
More information about the jcifs
mailing list