Commit c6370440 authored by Jakob Unterwurzacher's avatar Jakob Unterwurzacher Committed by Han-Wen Nienhuys

example/loopback: make -allow-other imply default_permissions

With -allow-other, other users can access the mountpoint.
However, without default_permissions, nobody checks file
permissions.

Make loopback behave more like a regular filesystem by
enabling default_permissions if -allow-other is passed.

Fixes xfstests generic/087:

$ sudo ./check-loopback generic/087
fuse-xfstests gocryptfs-2018-08-18/67408ac7
Thu 26 Dec 2019 03:08:54 PM UTC

loopback is /usr/local/bin/loopback
FSTYP         -- fuse.loopback
PLATFORM      -- Linux/x86_64 brikett 5.3.12-300.fc31.x86_64
MKFS_OPTIONS  -- /var/tmp/fuse-xfstests/check-loopback/scratchdev
MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /var/tmp/fuse-xfstests/check-loopback/scratchdev /var/tmp/fuse-xfstests/check-loopback/scratchdir

generic/087	 1s
Ran: generic/087
Passed all 1 tests

Runtime was 1 seconds, exit code 0

Change-Id: Ifa8ac38a3775c3cacf20d37638a95887c9c24f93
parent d13ebc4a
......@@ -96,6 +96,10 @@ func main() {
}
opts.Debug = *debug
opts.AllowOther = *other
if opts.AllowOther {
// Make the kernel check file permissions for us
opts.MountOptions.Options = append(opts.MountOptions.Options, "default_permissions")
}
// First column in "df -T": original dir
opts.MountOptions.Options = append(opts.MountOptions.Options, "fsname="+orig)
// Second column in "df -T" will be shown as "fuse." + Name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment