[fusefs] default_permission + allow_other not work as expected.

C. C. Tang hiyorin+cc at gmail.com
Wed Jan 18 06:00:20 UTC 2017


 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 at releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC
amd64


Problem:
according to manual of mount.fuse, mounting fusefs with option
default_permission and allow_other should allow access of mounted data by
other user and enable standard file permission checking by the system.

However it seems the permission check is not working as expected on FreeBSD.
I haved 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:
# 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
% cd /_test
% cat a/1
cat: a/1: Permission denied
% cat u/1
1

Expected output:
as a normal user
% cd /_test
% cat a/1
cat: a/1: Permission denied
% cat u/1
cat: u/1: Permission denied


More information about the freebsd-fs mailing list