lkml.org 
[lkml]   [2005]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] FUSE - don't check against zero fsuid
From
Date
Andrew,

This patch replaces check for zero fsuid with a capability check.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
diff -rup linux-2.6.11-rc1-mm1/fs/fuse/dir.c linux-2.6.11-rc1-mm1-fuse/fs/fuse/dir.c
--- linux-2.6.11-rc1-mm1/fs/fuse/dir.c 2005-01-14 12:30:07.000000000 +0100
+++ linux-2.6.11-rc1-mm1-fuse/fs/fuse/dir.c 2005-01-14 12:44:36.000000000 +0100
@@ -422,7 +422,7 @@ static int fuse_revalidate(struct dentry
if (!(fc->flags & FUSE_ALLOW_OTHER) &&
current->fsuid != fc->user_id &&
(!(fc->flags & FUSE_ALLOW_ROOT) ||
- current->fsuid != 0))
+ !capable(CAP_DAC_OVERRIDE)))
return -EACCES;
} else if (time_before_eq(jiffies, fi->i_time))
return 0;
@@ -435,7 +435,7 @@ static int fuse_permission(struct inode
struct fuse_conn *fc = get_fuse_conn(inode);

if (!(fc->flags & FUSE_ALLOW_OTHER) && current->fsuid != fc->user_id &&
- (!(fc->flags & FUSE_ALLOW_ROOT) || current->fsuid != 0))
+ (!(fc->flags & FUSE_ALLOW_ROOT) || !capable(CAP_DAC_OVERRIDE)))
return -EACCES;
else if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
int err = generic_permission(inode, mask, NULL);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.017 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site