fusefs default_permission + allow_other not work as expected?

Code:
# uname -a
FreeBSD bsd_test 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 01:43:23 UTC 2016 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64


Problem:
According to manual of mount.fuse, default_permission should let the OS to do file permission checking using the file mode and allow_other should allow access of mounted data by other user.

However it seems the permission check is not working as expected on FreeBSD. I have tried to reproduce it on CentOS7 and it works as expected. (user1 get permission denied error)

How to reproduce: (use unionfs as example)
as root:
Code:
# cd /_test
# mkdir a
# mkdir b
# echo "1" > a/1
# echo "2" > a/2
# chmod 600 a/1
# mkdir u
# unionfs -o default_permissions,allow_other a=RW:b=RO u
# ll u
total 8
-rw-------  1 root  wheel  2 Jan 18 21:23 1
-rw-r--r--  1 root  wheel  2 Jan 18 21:23 2
# cat a/1
1

==============
as a normal user
Code:
% cd /_test
% cat a/1
cat: a/1: Permission denied
% cat u/1
1

Expected output:
as a normal user
Code:
% cd /_test
% cat a/1
cat: a/1: Permission denied
% cat u/1
cat: u/1: Permission denied
 
Tested it and think you are right, the actual behavior of an fusefs-unionfs mount fs with these options does not conform to its own manual page.
But then, why not use the native mount -t unionfs a u and say bye to those obscure options. This probably served as an inspiration to the fuse implementation.
 
Thanks for reminding of the native unionfs.
However, I am not using only unionfs. Encfs is having the same problem too.

So it is a potential bug in fuse implementation of FreeBSD?
 
Back
Top