summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-11-16 03:44:37 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-11-16 04:44:06 -0800
commit36f696c7dbc785be464acae737f4c25ed3af861a (patch)
treeb4ac18726a8691ffd51d8c4e7dfbe220db162043 /rpc/rpc-lib/src
parent4cfd6e1b45da64429c3e10886e2ceb4e9c9deb5d (diff)
rpc-lib: Copy auxiliary GIDs into request from de-XDRed buffer
Fixes a problem where secondary groups are not accounted for in permission checks. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2045 (Write permission denied for non-primary group membership) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2045
Diffstat (limited to 'rpc/rpc-lib/src')
-rw-r--r--rpc/rpc-lib/src/auth-glusterfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/auth-glusterfs.c b/rpc/rpc-lib/src/auth-glusterfs.c
index 459cad87791..27869349182 100644
--- a/rpc/rpc-lib/src/auth-glusterfs.c
+++ b/rpc/rpc-lib/src/auth-glusterfs.c
@@ -155,6 +155,7 @@ int auth_glusterfs_authenticate (rpcsvc_request_t *req, void *priv)
{
int ret = RPCSVC_AUTH_REJECT;
struct auth_glusterfs_parms au = {0,};
+ int gidcount = 0;
if (!req)
return ret;
@@ -171,6 +172,9 @@ int auth_glusterfs_authenticate (rpcsvc_request_t *req, void *priv)
req->lk_owner = au.lk_owner;
req->auxgidcount = au.ngrps;
+ for (gidcount = 0; gidcount < au.ngrps; ++gidcount)
+ req->auxgids[gidcount] = au.groups[gidcount];
+
gf_log (GF_RPCSVC, GF_LOG_TRACE, "Auth Info: pid: %u, uid: %d"
", gid: %d, owner: %"PRId64,
req->pid, req->uid, req->gid, req->lk_owner);