summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-11-16 04:56:37 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-11-16 04:44:10 -0800
commit015b08d64dfea093d8fcd0a30b655469b18bbc2e (patch)
tree23042f06c07556ca004589e80b180d78f097c5dc /rpc/rpc-lib
parent36f696c7dbc785be464acae737f4c25ed3af861a (diff)
rpc-lib: Fail auth-unix if more than 16 gids found
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')
-rw-r--r--rpc/rpc-lib/src/auth-glusterfs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/auth-glusterfs.c b/rpc/rpc-lib/src/auth-glusterfs.c
index 27869349182..9a9021046cf 100644
--- a/rpc/rpc-lib/src/auth-glusterfs.c
+++ b/rpc/rpc-lib/src/auth-glusterfs.c
@@ -172,6 +172,11 @@ int auth_glusterfs_authenticate (rpcsvc_request_t *req, void *priv)
req->lk_owner = au.lk_owner;
req->auxgidcount = au.ngrps;
+ if (req->auxgidcount > 16) {
+ ret = RPCSVC_AUTH_REJECT;
+ goto err;
+ }
+
for (gidcount = 0; gidcount < au.ngrps; ++gidcount)
req->auxgids[gidcount] = au.groups[gidcount];