diff options
author | Anand Avati <avati@redhat.com> | 2013-05-02 23:36:01 -0700 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-09-09 17:25:38 -0700 |
commit | 8eb866cc0c3ed17f7cd9ca7d6cfc3dc3de140835 (patch) | |
tree | 33c9880e6a30bda624168907fd2e2a638528eee6 /libglusterfs/src/syncop.h | |
parent | 7a28d8537817d6285d611e08393c1614c42a03be (diff) |
core: increase the auxillary group limit to 65536
Make the allocation of groups dynamic and increase the limit
to 65536.
Change-Id: I702364ff460e3a982e44ccbcb3e337cac9c2df51
BUG: 953694
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5172
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs/src/syncop.h')
-rw-r--r-- | libglusterfs/src/syncop.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 04eb9e5fe8f..d0417b26026 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -239,6 +239,7 @@ static inline call_frame_t * syncop_create_frame (xlator_t *this) { call_frame_t *frame = NULL; + int ngrps = -1; frame = create_frame (this, this->ctx->pool); if (!frame) @@ -247,7 +248,21 @@ syncop_create_frame (xlator_t *this) frame->root->pid = getpid(); frame->root->uid = geteuid (); frame->root->gid = getegid (); - frame->root->ngrps = getgroups (GF_MAX_AUX_GROUPS, frame->root->groups); + ngrps = getgroups (0, 0); + if (ngrps < 0) { + STACK_DESTROY (frame->root); + return NULL; + } + + if (call_stack_alloc_groups (frame->root, ngrps) != 0) { + STACK_DESTROY (frame->root); + return NULL; + } + + if (getgroups (ngrps, frame->root->groups) < 0) { + STACK_DESTROY (frame->root); + return NULL; + } return frame; } |