[jcifs] SmbFile.canWrite() question

Tony Thompson tony.thompson at stone-ware.com
Thu Feb 2 18:58:24 GMT 2006


OK, that is it.  Is there any way to make jCIFS check your "effective
rights" for a particular file or directory?

Tony

>>> Michael B Allen <mba2000 at ioplex.com> 02/02/06 01:05PM >>>
On Thu, 02 Feb 2006 11:42:32 -0500
"Tony Thompson" <tony.thompson at stone-ware.com> wrote:

> I have a share on a Windows server that I have given a user read
only
> access to.  If I connect to that share with a Windows client, I
really
> do not have any rights to update anything on the share.  However,
with
> jCIFS, SmbFile.canWrite() returns true for any file/directory on the
> share.  Is there some debug that I can turn on to see what is going
on
> here or is this a known issue?

JCIFS only looks at file attributes. Meaning canWrite will return true
if FILE_ATTRIBUTE_READONLY is not set. It doesn't know anything about
ACLs. The only way to really know if the user can open and write to
the
file is to try to open and write to the file.

Mike


More information about the jcifs mailing list