Only set allow_other when running as root

This commit is contained in:
Antonio SJ Musumeci 2023-10-29 01:44:18 -05:00
parent 7890a4996c
commit d6a2f06797
3 changed files with 24 additions and 14 deletions

View file

@ -26,6 +26,7 @@
#include "num.hpp"
#include "policy.hpp"
#include "str.hpp"
#include "syslog.hpp"
#include "version.hpp"
#include "fuse.h"
@ -116,6 +117,10 @@ void
set_default_options(fuse_args *args_)
{
set_option("default_permissions",args_);
if(geteuid() == 0)
set_option("allow_other",args_);
else
syslog_notice("not auto setting allow_other since not running as root");
}
static
@ -124,7 +129,6 @@ should_ignore(const std::string &key_)
{
static const std::set<std::string> IGNORED_KEYS =
{
"allow_other",
"atomic_o_trunc",
"big_writes",
"cache.open",