path: root/xlators/features/snapview-server
diff options
authorSachin Pandit <>2014-11-25 07:20:38 +0530
committerVijay Bellur <>2014-12-01 08:04:06 -0800
commiteee41566697583f74784d9f9ff78651535d6eb91 (patch)
treeb84841671ca459ae8e3e07999d4eb37999af0f9d /xlators/features/snapview-server
parenta93164cd2a7f7ec37cf30d52b1a73fdc211981c3 (diff)
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: Reviewed-by: Vijaikumar Mallikarjuna <> Reviewed-by: Rajesh Joseph <> Tested-by: Gluster Build System <> Reviewed-by: Vijay Bellur <>
Diffstat (limited to 'xlators/features/snapview-server')
1 files changed, 6 insertions, 1 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c
index d66150e..8655bf5 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) {