From 192318a2316d84a3de9d28c29fbc73aae3e75206 Mon Sep 17 00:00:00 2001 From: Rahat Mahmood Date: Thu, 11 Mar 2021 17:54:53 -0800 Subject: fusefs: Implement default_permissions and allow_other mount options. By default, fusefs defers node permission checks to the server. The default_permissions mount option enables the usual unix permission checks based on the node owner and mode bits. Previously fusefs was incorrectly checking permissions unconditionally. Additionally, fusefs should restrict filesystem access to processes started by the mount owner to prevent the fuse daemon from gaining priviledge over other processes. The allow_other mount option overrides this behaviour. Previously fusefs was incorrectly skipping this check. Updates #3229 PiperOrigin-RevId: 362419092 --- test/fuse/linux/mount_test.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/fuse/linux/mount_test.cc') diff --git a/test/fuse/linux/mount_test.cc b/test/fuse/linux/mount_test.cc index 8a5478116..276f842ea 100644 --- a/test/fuse/linux/mount_test.cc +++ b/test/fuse/linux/mount_test.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include "gtest/gtest.h" #include "test/util/mount_util.h" @@ -29,7 +30,9 @@ namespace { TEST(FuseMount, Success) { const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(Open("/dev/fuse", O_WRONLY)); - std::string mopts = absl::StrCat("fd=", std::to_string(fd.get())); + std::string mopts = + absl::StrFormat("fd=%d,user_id=%d,group_id=%d,rootmode=0777", fd.get(), + getuid(), getgid()); const auto dir = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateDir()); -- cgit v1.2.3