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