From eee41566697583f74784d9f9ff78651535d6eb91 Mon Sep 17 00:00:00 2001 From: Sachin Pandit Date: Tue, 25 Nov 2014 07:20:38 +0530 Subject: USS : fill proper uid and gid during a access call from nfs Problem : when an user tries to access a file/folder for which he does not have a proper permission required then fuse gives out a proper error "Permission denied", but nfs does not give out that error, rather he can access the file/folder. The reason being uid and gid of call frame stack takes a default value of uid and gid which point to root permission. Solution : Set a proper uid and gid during a access call from nfs Change-Id: Ib060706fde66ec7e60f242fab1f3e59122ed2245 BUG: 1167580 Signed-off-by: Sachin Pandit Reviewed-on: http://review.gluster.org/9194 Reviewed-by: Vijaikumar Mallikarjuna Reviewed-by: Rajesh Joseph Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/snapview-server/src/snapview-server.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators/features/snapview-server') diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c index d66150e769a..8655bf5636c 100644 --- a/xlators/features/snapview-server/src/snapview-server.c +++ b/xlators/features/snapview-server/src/snapview-server.c @@ -2016,8 +2016,13 @@ svs_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int mask, fuse and nfs. So set frame->root->pid as fspid of the syncop if the call came from nfs */ - if (!is_fuse_call) + if (!is_fuse_call) { syncopctx_setfspid (&frame->root->pid); + syncopctx_setfsuid (&frame->root->uid); + syncopctx_setfsgid (&frame->root->gid); + syncopctx_setfsgroups (frame->root->ngrps, + frame->root->groups); + } ret = glfs_h_access (fs, object, mask); if (ret < 0) { -- cgit