On Date: Wed, 3 Sep 2014 18:43:34 +0000, David Holland wrote:
> On Wed, Sep 03, 2014 at 04:01:45PM +0000, Emmanuel Dreyfus wrote:
>  > Modified Files:
>  >      src/lib/libperfuse: ops.c perfuse.c
>  > 
>  > Log Message:
>  > Improve POSIX compliance of FUSE filesystems through PERUSE
>  > - access denied is EPERM and not EACCES
> 
> wait, what?

EACCES is when you lack permission for the parent directories. 
This errno is enforced by the LOOKUP method. If you have access
to the directory but not to the object itself, you get EPERM,
and this is enforced by the SETATTR method, which will not be
called if you did not succeed LOOKUP first.

Here is below what happens on NetBSD's FFS. The patch makes
sure FUSE filesystem have the same correct behavior.

# install -d -o root -m 700 /tmp/test 
# install -c -o root -m 644 /dev/null /tmp/test/file
# su -m nobody -c 'chmod 666 /tmp/test/file'
chmod: /tmp/test/file: Permission denied
# grep 'Permission denied' /usr/include/sys/errno.h  
#define EACCES          13              /* Permission denied */

# chmod 755 /tmp/test
# su -m nobody -c 'chmod 666 /tmp/test/file' 
chmod: /tmp/test/file: Operation not permitted
# grep 'Operation not permitted' /usr/include/sys/errno.h  
#define EPERM           1               /* Operation not permitted */

The error was caught by POSIX filesystem regression test suite. 
If I am wrong then the test suite and FFS are wrong too, or I 
misunderstood something.

Please Cc: me for the reply because I am not subscribed to this 
list. And your reply is needed even if you agree because I filled
a pullup ticket (I did not see you reply), which is now stalled 
because of your objection: I now need your approval :-)

-- 
Emmanuel Dreyfus
m...@netbsd.org

Reply via email to