summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorSachin Pandit <spandit@redhat.com>2014-11-25 07:20:38 +0530
committerVijay Bellur <vbellur@redhat.com>2014-12-01 08:04:06 -0800
commiteee41566697583f74784d9f9ff78651535d6eb91 (patch)
treeb84841671ca459ae8e3e07999d4eb37999af0f9d /xlators/features
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 <spandit@redhat.com> Reviewed-on: http://review.gluster.org/9194 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/snapview-server/src/snapview-server.c7
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 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) {