[jcifs] Writeing Problem

Kai Kuhn kku at shd.de
Thu Mar 25 09:30:32 GMT 2004


Eric wrote:
> 
>>             Permission per = share.getPermission();
>>             System.out.println("Permissions:\n");
>>             System.out.println(per.getName());
>>             System.out.println(per.getActions());
> 
> 
> URLConnection.getPermission() gives the minimum permissions necessary to 
> make the connection; i.e., java.security.AllPermission being returned 
> here implies you should have AllPermission granted via your policy to 
> make the connection (this is the default value returned by 
> URLConnection.getPermission(); we should actually probably override this 
> to return null, as there could be tools that would enforce this).  It 
> doesn't relate to the file permissions granted to the user on the target 
> SmbFile; there isn't currently a way to retrieve those.
> 
> 
> Eric

ok
thank you.
I found a workarround.
But I think there is a bug in the updatefile.copyTo(newshare) method.
As I wrote this method fails execution with the access denied exception.
But I have full permisions on this share!

jcifs.smb.SmbAuthException: Access denied
     at jcifs.smb.SmbTransport.send(SmbTransport.java:750)
     at jcifs.smb.SmbSession.send(SmbSession.java:109)
     at jcifs.smb.SmbTree.send(SmbTree.java:100)
     at jcifs.smb.SmbFile.send(SmbFile.java:619)
     at jcifs.smb.SmbFile.open0(SmbFile.java:709)
     at jcifs.smb.SmbFile.open(SmbFile.java:726)
     at jcifs.smb.SmbFile.copyTo0(SmbFile.java:1726)
     at jcifs.smb.SmbFile.copyTo(SmbFile.java:1830)

But the file-transfer works fine with an FileoutputStream on the smb share.

kai Kuhn/


More information about the jcifs mailing list