diff options
Diffstat (limited to 'libglusterfs')
| -rw-r--r-- | libglusterfs/src/protocol.h | 14 | ||||
| -rw-r--r-- | libglusterfs/src/stack.h | 6 | 
2 files changed, 20 insertions, 0 deletions
diff --git a/libglusterfs/src/protocol.h b/libglusterfs/src/protocol.h index ede5adae4e8..450e38731c2 100644 --- a/libglusterfs/src/protocol.h +++ b/libglusterfs/src/protocol.h @@ -959,10 +959,24 @@ typedef struct {  typedef struct { } __attribute__((packed)) gf_cbk_forget_rsp_t; +/* This corresponds to the max 16 number of group IDs that are sent through an + * RPC request. Since NFS is the only one going to set this, we can be safe + * in keeping this size hardcoded. + */ +#define GF_REQUEST_MAXGROUPS    16 +  typedef struct {  	uint32_t pid;  	uint32_t uid;  	uint32_t gid; + +        /* Number of groups being sent through the array above. */ +        uint32_t ngrps; + +        /* Array of groups to which the uid belongs apart from the primary group +         * in gid. +         */ +        uint32_t groups[GF_REQUEST_MAXGROUPS];  } __attribute__ ((packed)) gf_hdr_req_t; diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index d4941a39f49..0af9ed35991 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -42,6 +42,7 @@ typedef struct _call_pool_t call_pool_t;  #include "list.h"  #include "common-utils.h"  #include "globals.h" +#include "protocol.h"  typedef int32_t (*ret_fn_t) (call_frame_t *frame, @@ -92,6 +93,8 @@ struct _call_stack_t {  	uid_t                         uid;  	gid_t                         gid;  	pid_t                         pid; +        uint32_t                      ngrps; +        uint32_t                      groups[GF_REQUEST_MAXGROUPS];  	call_frame_t                  frames;  	int32_t                       op; @@ -253,6 +256,9 @@ copy_frame (call_frame_t *frame)  	newstack->uid = oldstack->uid;  	newstack->gid = oldstack->gid;  	newstack->pid = oldstack->pid; +        newstack->ngrps = oldstack->ngrps; +        memcpy (newstack->groups, oldstack->groups, +                sizeof (uint32_t) * GF_REQUEST_MAXGROUPS);  	newstack->unique = oldstack->unique;  	newstack->frames.this = frame->this;  | 
