summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-handshake.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-09-20 13:23:08 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-20 01:48:35 -0700
commitb2e14374e20440d8d298c3bdb7d8290354330967 (patch)
tree08fc6a9cd5a4ac93c7943d25064c1712e0b5989a /xlators/protocol/server/src/server-handshake.c
parent8c5237bbd3a580c9287d18a3e71808e87f1edf9e (diff)
glusterfs protocol: handshake to log the version of the peer
* As RPC program's name is just used for logging, we now have 'PACKAGE_VERSION' part of the string, which gets logged in client side. * From client, we send the PACKAGE_VERSION in handshake dictionary, which gets logged on serverside handshake. The change doesn't break any compatibility between client or server as it would only enhance the logging part of handshake. Change-Id: Ie7f498af2f5d3f97be37c8d982061cb6021883ce BUG: 3589 Reviewed-on: http://review.gluster.com/468 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/protocol/server/src/server-handshake.c')
-rw-r--r--xlators/protocol/server/src/server-handshake.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c
index fc22fffe4f0..f04dc5d3471 100644
--- a/xlators/protocol/server/src/server-handshake.c
+++ b/xlators/protocol/server/src/server-handshake.c
@@ -345,6 +345,7 @@ server_setvolume (rpcsvc_request_t *req)
dict_t *params = NULL;
char *name = NULL;
char *process_uuid = NULL;
+ char *clnt_version = NULL;
xlator_t *xl = NULL;
char *msg = NULL;
char *volfile_key = NULL;
@@ -525,13 +526,20 @@ server_setvolume (rpcsvc_request_t *req)
"Authentication module not initialized");
}
+ ret = dict_get_str (params, "client-version", &clnt_version);
+ if (ret)
+ gf_log (this->name, GF_LOG_INFO, "client-version not set, "
+ "may be of older version");
+
ret = gf_authenticate (params, config_params,
conf->auth_modules);
if (ret == AUTH_ACCEPT) {
+
gf_log (this->name, GF_LOG_INFO,
- "accepted client from %s",
- (peerinfo)?peerinfo->identifier:"");
+ "accepted client from %s (version: %s)",
+ (peerinfo) ? peerinfo->identifier : "<>",
+ (clnt_version) ? clnt_version : "old");
op_ret = 0;
conn->bound_xl = xl;
ret = dict_set_str (reply, "ERROR", "Success");
@@ -540,8 +548,10 @@ server_setvolume (rpcsvc_request_t *req)
"failed to set error msg");
} else {
gf_log (this->name, GF_LOG_ERROR,
- "Cannot authenticate client from %s",
- (peerinfo)? peerinfo->identifier:"<>");
+ "Cannot authenticate client from %s %s",
+ (peerinfo) ? peerinfo->identifier : "<>",
+ (clnt_version) ? clnt_version : "old");
+
op_ret = -1;
op_errno = EACCES;
ret = dict_set_str (reply, "ERROR", "Authentication failed");