From 5821d2cf591789760e790d4af0575d1b9754c08d Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 3 Dec 2009 05:15:09 +0000 Subject: core, client, server: Support auxiliary group ids Support for auxiliary group ids is needed for transmission of more than one group id right through the xlator tree so that posix can use these group ids to perform in-house permission tests. The in-house permission checks are needed so that we do not have to depend on non-POSIX calls like setfs[ug]id for changing the user for each fop. The setfs[ug]id are also limited since they do not allow setting multiple group id as required for operation with NFS, which sends us all the group ids for a process issuing file system requests. Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 400 (Support auxiliary gids in GlusterFS) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=400 --- xlators/protocol/server/src/server-protocol.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'xlators/protocol/server/src') diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index b7b644765..94a1ded32 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -6108,6 +6108,26 @@ out: return frame; } + +int +server_decode_groups (call_frame_t *frame, gf_hdr_common_t *hdr) +{ + int i = 0; + + if ((!frame) || (!hdr)) + return 0; + + frame->root->ngrps = ntoh32 (hdr->req.ngrps); + if (frame->root->ngrps == 0) + return 0; + + for (; i < frame->root->ngrps; ++i) + frame->root->groups[i] = ntoh32 (hdr->req.groups[i]); + + return 0; +} + + /* * get_frame_for_call - create a frame into the capable of * generating and replying the reply packet by itself. @@ -6134,6 +6154,7 @@ get_frame_for_call (transport_t *trans, gf_hdr_common_t *hdr) frame->root->unique = ntoh64 (hdr->callid); /* which call */ frame->root->gid = ntoh32 (hdr->req.gid); frame->root->pid = ntoh32 (hdr->req.pid); + server_decode_groups (frame, hdr); return frame; } -- cgit