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/client/src/client-protocol.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'xlators/protocol/client/src/client-protocol.c') diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index d0f33e730..3ad41009c 100644 --- a/xlators/protocol/client/src/client-protocol.c +++ b/xlators/protocol/client/src/client-protocol.c @@ -538,6 +538,24 @@ out: return 0; } +int +client_encode_groups (call_frame_t *frame, gf_hdr_common_t *hdr) +{ + int i = 0; + if ((!frame) || (!hdr)) + return -1; + + hdr->req.ngrps = hton32 (frame->root->ngrps); + if (frame->root->ngrps == 0) + return 0; + + for (; i < frame->root->ngrps; ++i) + hdr->req.groups[i] = hton32 (frame->root->groups[i]); + + return 0; +} + + int protocol_client_xfer (call_frame_t *frame, xlator_t *this, transport_t *trans, int type, int op, @@ -572,6 +590,7 @@ protocol_client_xfer (call_frame_t *frame, xlator_t *this, transport_t *trans, hdr->req.uid = hton32 (frame->root->uid); hdr->req.gid = hton32 (frame->root->gid); hdr->req.pid = hton32 (frame->root->pid); + client_encode_groups (frame, hdr); } if (conn->connected == 0) -- cgit