summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server
diff options
context:
space:
mode:
authorRajesh Amaravathi <rajesh@redhat.com>2013-02-05 16:52:16 +0530
committerAnand Avati <avati@redhat.com>2013-02-06 16:14:55 -0800
commit2197c8b41423a7a9a5e55db0d3a5a27131966e72 (patch)
treeb355be35c3efc501137369b45940b12e52a6f110 /xlators/nfs/server
parent45c04e107c365d29ca9872b5e2d12c932bf43a24 (diff)
nfs/nlm: use req's uid and gid for open_and_resume
Previously, NLM was setting the frame->root->{uid,gid} to root by default. This causes permission problems with root squashing for lock calls. Now, we obtain the uid and gid from rpc request. And duplicate #defines are removed from rpcsvc.h Change-Id: I5d6c87aed8d04aab2619bb913408048c0a02d1e7 BUG: 906884 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.org/4466 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r--xlators/nfs/server/src/nlm4.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c
index 498342eb1b0..aee14e9c8cd 100644
--- a/xlators/nfs/server/src/nlm4.c
+++ b/xlators/nfs/server/src/nlm4.c
@@ -630,14 +630,11 @@ nlm4_file_open_and_resume(nfs3_call_state_t *cs, nlm4_resume_fn_t resume)
}
frame->root->pid = NFS_PID;
- frame->root->uid = 0;
- frame->root->gid = 0;
+ frame->root->uid = rpcsvc_request_uid (cs->req);
+ frame->root->gid = rpcsvc_request_gid (cs->req);
frame->local = cs;
- /*
- * This is the only place that we call STACK_WIND without nfs_fix_groups,
- * because in this particular case the relevant identify is in lk_owner and
- * we don't care about the fields that nfs_fix_groups would set up.
- */
+ nfs_fix_groups (cs->nfsx, frame->root);
+
STACK_WIND_COOKIE (frame, nlm4_file_open_cbk, cs->vol, cs->vol,
cs->vol->fops->open, &cs->resolvedloc, O_RDWR,
cs->fd, NULL);