[jcifs] SmbFile.canWrite() question

Michael B Allen mba2000 at ioplex.com
Thu Feb 2 19:28:09 GMT 2006

On Thu, 02 Feb 2006 13:58:24 -0500
"Tony Thompson" <tony.thompson at stone-ware.com> wrote:

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

Not stock jCIFS no. You could use Jarapac to do the necessary RPCs or
you could use JNDI to query AD but I can't direct you further wrt that.


> 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