diff options
author | Amar Tumballi <amarts@redhat.com> | 2017-11-07 00:07:12 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2018-01-17 06:00:39 +0000 |
commit | 75b063d76d78b5d1e0e53a1be37dc5ad9200f7b2 (patch) | |
tree | ae9149d96a2f850c2128de0328e13634fec09a5e /xlators | |
parent | e3a191a0d3ea0706f4827ebdb6e5161623f2c5f1 (diff) |
rpc/*: auth-header changes
Introduce another authentication header which can now send more data.
This is useful because this data can be common for all the fops, and
we don't need to change all the signatures.
As part of this, made rpc-clnt.c little more modular to support multiple
authentication structures.
stack.h changes are placeholder for the ctime etc, can be moved later
based on need.
updates #384
Change-Id: I6111c13cfd2ec92e2b4e9295896bf62a8a33b2c7
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/nfs/server/src/nfs-fops.c | 3 | ||||
-rw-r--r-- | xlators/protocol/client/src/client-handshake.c | 25 | ||||
-rw-r--r-- | xlators/protocol/server/src/server-helpers.c | 3 |
3 files changed, 20 insertions, 11 deletions
diff --git a/xlators/nfs/server/src/nfs-fops.c b/xlators/nfs/server/src/nfs-fops.c index 601f29fcef9..7c2aab53573 100644 --- a/xlators/nfs/server/src/nfs-fops.c +++ b/xlators/nfs/server/src/nfs-fops.c @@ -44,7 +44,8 @@ nfs_fix_groups (xlator_t *this, call_stack_t *root) } /* RPC enforces the GF_AUTH_GLUSTERFS_MAX_GROUPS limit */ - max_groups = GF_AUTH_GLUSTERFS_MAX_GROUPS(root->lk_owner.len); + max_groups = GF_AUTH_GLUSTERFS_MAX_GROUPS(root->lk_owner.len, + AUTH_GLUSTERFS_v2); agl = gid_cache_lookup(&priv->gid_cache, root->uid, 0, 0); if (agl) { diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c index 68ea20ffed7..2d779fa39b7 100644 --- a/xlators/protocol/client/src/client-handshake.c +++ b/xlators/protocol/client/src/client-handshake.c @@ -20,6 +20,7 @@ #include "portmap-xdr.h" #include "rpc-common-xdr.h" #include "client-messages.h" +#include "xdr-rpc.h" #define CLIENT_REOPEN_MAX_ATTEMPTS 1024 extern rpc_clnt_prog_t clnt3_3_fop_prog; @@ -1482,35 +1483,39 @@ select_server_supported_programs (xlator_t *this, gf_prog_detail *prog) while (trav) { /* Select 'programs' */ if ((clnt3_3_fop_prog.prognum == trav->prognum) && - (clnt3_3_fop_prog.progver == trav->progver)) { + (clnt3_3_fop_prog.progver == trav->progver) && + !conf->fops) { conf->fops = &clnt3_3_fop_prog; - gf_msg (this->name, GF_LOG_INFO, 0, - PC_MSG_VERSION_INFO, "Using Program %s, " - "Num (%"PRId64"), Version (%"PRId64")", - trav->progname, trav->prognum, trav->progver); + if (conf->rpc) + conf->rpc->auth_value = AUTH_GLUSTERFS_v2; ret = 0; } if ((clnt4_0_fop_prog.prognum == trav->prognum) && (clnt4_0_fop_prog.progver == trav->progver)) { conf->fops = &clnt4_0_fop_prog; - gf_msg (this->name, GF_LOG_INFO, 0, - PC_MSG_VERSION_INFO, "Using Program %s," - " Num (%"PRId64"), Version (%"PRId64")", - trav->progname, trav->prognum, trav->progver); + if (conf->rpc) + conf->rpc->auth_value = AUTH_GLUSTERFS_v3; ret = 0; /* this is latest program, lets use it */ goto out; } if (ret) { - gf_msg_trace (this->name, 0, + gf_msg_debug (this->name, 0, "%s (%"PRId64") not supported", trav->progname, trav->progver); } trav = trav->next; } + if (!ret) + gf_msg (this->name, GF_LOG_INFO, 0, + PC_MSG_VERSION_INFO, "Using Program %s," + " Num (%d), Version (%d)", + conf->fops->progname, conf->fops->prognum, + conf->fops->progver); + out: return ret; } diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index 7ff5f16e7f0..1f9e9e8acb2 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -507,6 +507,9 @@ get_frame_from_request (rpcsvc_request_t *req) sizeof (trans->peerinfo.identifier)); } + /* more fields, for the clients which are 3.x series this will be 0 */ + frame->root->flags = req->flags; + frame->root->ctime = req->ctime; frame->local = req; |