From: Miklos Szeredi This patch removes checks for zero uid (spotted by you). These cannot be replaced with checking for capable(CAP_SYS_ADMIN), since for mount this capability will always be set. Better aproach seems to be to move the checks to fusermount (the mount utility provided with the FUSE library). Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton --- 25-akpm/fs/fuse/inode.c | 32 -------------------------------- 1 files changed, 32 deletions(-) diff -puN fs/fuse/inode.c~fuse-remove-mount_max-and-user_allow_other-module-parameters fs/fuse/inode.c --- 25/fs/fuse/inode.c~fuse-remove-mount_max-and-user_allow_other-module-parameters Fri Jan 14 15:10:52 2005 +++ 25-akpm/fs/fuse/inode.c Fri Jan 14 15:10:52 2005 @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -25,15 +24,6 @@ MODULE_LICENSE("GPL"); spinlock_t fuse_lock; static kmem_cache_t *fuse_inode_cachep; -static int mount_count; - -static int user_allow_other; -module_param(user_allow_other, int, 0644); -MODULE_PARM_DESC(user_allow_other, "Allow non root user to specify the \"allow_other\" or \"allow_root\" mount options"); - -static int mount_max = 1000; -module_param(mount_max, int, 0644); -MODULE_PARM_DESC(mount_max, "Maximum number of FUSE mounts allowed, if -1 then unlimited (default: 1000)"); #define FUSE_SUPER_MAGIC 0x65735546 @@ -198,7 +188,6 @@ static void fuse_put_super(struct super_ struct fuse_conn *fc = get_fuse_conn_super(sb); spin_lock(&fuse_lock); - mount_count --; fc->sb = NULL; fc->user_id = 0; fc->flags = 0; @@ -435,17 +424,6 @@ static struct super_operations fuse_supe .show_options = fuse_show_options, }; -static int inc_mount_count(void) -{ - int success = 0; - spin_lock(&fuse_lock); - mount_count ++; - if (mount_max == -1 || mount_count <= mount_max) - success = 1; - spin_unlock(&fuse_lock); - return success; -} - static int fuse_fill_super(struct super_block *sb, void *data, int silent) { struct fuse_conn *fc; @@ -457,11 +435,6 @@ static int fuse_fill_super(struct super_ if (!parse_fuse_opt((char *) data, &d)) return -EINVAL; - if (!user_allow_other && - (d.flags & (FUSE_ALLOW_OTHER | FUSE_ALLOW_ROOT)) && - current->uid != 0) - return -EPERM; - sb->s_blocksize = PAGE_CACHE_SIZE; sb->s_blocksize_bits = PAGE_CACHE_SHIFT; sb->s_magic = FUSE_SUPER_MAGIC; @@ -482,10 +455,6 @@ static int fuse_fill_super(struct super_ *get_fuse_conn_super_p(sb) = fc; - err = -ENFILE; - if (!inc_mount_count() && current->uid != 0) - goto err; - err = -ENOMEM; root = get_root_inode(sb, d.rootmode); if (root == NULL) @@ -501,7 +470,6 @@ static int fuse_fill_super(struct super_ err: spin_lock(&fuse_lock); - mount_count --; fc->sb = NULL; fuse_release_conn(fc); spin_unlock(&fuse_lock); _