From 40cdb88962cff1d32cd46cb089ad8bcd9be3d62d Mon Sep 17 00:00:00 2001 From: Pranith K Date: Mon, 24 Jan 2011 01:49:23 +0000 Subject: features/access-control: skip access-tests if the call is from fuse Fuse cant send aux gids. So access-control checks treat non-primary-group membership of user as "other". So skip access-control checks if the call is from fuse. We added a hack to treat all calls with pid set to 1 as calls from nfs. So for calls with pid not 1 we skip the access-control checks on all fops. Signed-off-by: Pranith Kumar K Signed-off-by: Anand V. Avati BUG: 2296 (svn / subversion fails on gluster volume (replicated and non-replicated)) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2296 --- libglusterfs/src/stack.c | 11 +++++++++++ libglusterfs/src/stack.h | 3 +++ 2 files changed, 14 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/stack.c b/libglusterfs/src/stack.c index b2659c57fe3..53c21f7c625 100644 --- a/libglusterfs/src/stack.c +++ b/libglusterfs/src/stack.c @@ -163,3 +163,14 @@ gf_proc_dump_pending_frames (call_pool_t *call_pool) UNLOCK (&(call_pool->lock)); } +gf_boolean_t +__is_fuse_call (call_frame_t *frame) +{ + gf_boolean_t is_fuse_call = _gf_false; + GF_ASSERT (frame); + GF_ASSERT (frame->root); + + if (NFS_PID != frame->root->pid) + is_fuse_call = _gf_true; + return is_fuse_call; +} diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index b06470bf5fc..f06267c3848 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -45,6 +45,7 @@ typedef struct _call_pool_t call_pool_t; #include "common-utils.h" #include "globals.h" +#define NFS_PID 1 typedef int32_t (*ret_fn_t) (call_frame_t *frame, call_frame_t *prev_frame, xlator_t *this, @@ -363,4 +364,6 @@ create_frame (xlator_t *xl, call_pool_t *pool) void gf_proc_dump_pending_frames(call_pool_t *call_pool); +gf_boolean_t +__is_fuse_call (call_frame_t *frame); #endif /* _STACK_H */ -- cgit