Strange behavior of access()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange behavior of access()

Jean-Pierre André
Hi,

I am currently implementing permission handling for ntfs-3g,
which relies on FUSE for handling user requests.

I am having difficulties with access(), which always returns
0 (meaning allowed) for R_OK and W_OK for an existing file
with any permission setting (for instance after a chmod 000).
The result is as expected for X_OK though.

Apparently access() is implemented through activation of
method .getattr, and I am reasonably sure getattr returns
the correct permission, uid and gid. I have traced activations
of other methods, but only .getattr appears to be called.

Has anybody experienced this before, and can somebody give
suggestions as to how to fix it ?

If needed I can post a simple test program (just doing
file creation, chmod and access), I can even post a full
ntfs-3g test environment, but this would probably not be
much helpful.

Regards

Jean-Pierre


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: Strange behavior of access()

Miklos Szeredi
> I am currently implementing permission handling for ntfs-3g,
> which relies on FUSE for handling user requests.
>
> I am having difficulties with access(), which always returns
> 0 (meaning allowed) for R_OK and W_OK for an existing file
> with any permission setting (for instance after a chmod 000).
> The result is as expected for X_OK though.
>
> Apparently access() is implemented through activation of
> method .getattr, and I am reasonably sure getattr returns
> the correct permission, uid and gid. I have traced activations
> of other methods, but only .getattr appears to be called.

You need to use the 'default_permissions' mount option to make access
checking work the way you expect ;)

Miklos
5B

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel