From acb4d36c3c91ffc076e76bd11ef8064bd51b4716 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 2 Jul 2004 16:20:45 +0000 Subject: minor features --- kernel/inode.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'kernel/inode.c') diff --git a/kernel/inode.c b/kernel/inode.c index d94b3b2..f0ad932 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -22,6 +22,19 @@ #include "compat/parser.h" #endif + +static int user_allow_other; + +#ifdef KERNEL_2_6 +#include +module_param(user_allow_other, int, 0); +#else +MODULE_PARM(user_allow_other, "i"); +#endif + +MODULE_PARM_DESC(user_allow_other, "Allow non root user to specify the \"allow_other\" mount option"); + + #define FUSE_SUPER_MAGIC 0x65735546 #ifndef KERNEL_2_6 @@ -309,7 +322,8 @@ static int fuse_read_super(struct super_block *sb, void *data, int silent) if (!parse_fuse_opt((char *) data, &d)) return -EINVAL; - if ((d.flags & FUSE_ALLOW_OTHER) && !capable(CAP_SYS_ADMIN)) + if (!user_allow_other && (d.flags & FUSE_ALLOW_OTHER) && + current->uid != 0) return -EPERM; sb->s_blocksize = PAGE_CACHE_SIZE; -- cgit v1.2.3