diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2017-05-22 20:23:06 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-05-24 12:15:06 +0000 |
commit | b1fbc695a63801a3a2c62738fd6660388123724a (patch) | |
tree | 0fba7f7077e12d7a5a29152e40632678680a5ea2 /xlators/mgmt/glusterd/src/glusterd-handshake.c | |
parent | 0bcf9143f500dd519c887af2b6948e2d332b3bfd (diff) |
glusterd: ignore incorrect uuid validation if uuid_str is empty
If uuid_str is not filled up in dictionary (when glusterd bit is old),
we shouldn't be additional validation with peer uuid otherwise the
handshake request will fail.
Refer :
http://lists.gluster.org/pipermail/gluster-users/2017-May/031187.html
Credits : pawan@platform.sh
Change-Id: I2c30bf0490c31d1418b31d555e7758696e79409f
BUG: 1454375
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://review.gluster.org/17358
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handshake.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handshake.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index bcffa5f9969..214dc6abd98 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -1130,20 +1130,25 @@ gd_validate_mgmt_hndsk_req (rpcsvc_request_t *req, dict_t *dict) * node due to a reinstall, in that case the validation should fail! */ rcu_read_lock (); - peer = glusterd_peerinfo_find (NULL, hostname); - if (!peer) { - ret = -1; - } else if (peer && glusterd_peerinfo_find (peer_uuid, NULL) != NULL) { - ret = 0; + if (!uuid_str) { + ret = (glusterd_peerinfo_find (NULL, hostname) == NULL); } else { - gf_msg (this->name, GF_LOG_ERROR, 0, - GD_MSG_HANDSHAKE_REQ_REJECTED, "Request from peer %s " - "has an entry in peerinfo, but uuid does not match", - req->trans->peerinfo.identifier); - ret = -1; + peer = glusterd_peerinfo_find (NULL, hostname); + if (!peer) { + ret = -1; + } else if (peer && + glusterd_peerinfo_find (peer_uuid, NULL) != NULL) { + ret = 0; + } else { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_HANDSHAKE_REQ_REJECTED, "Request from " + "peer %s has an entry in peerinfo, but uuid " + "does not match", + req->trans->peerinfo.identifier); + ret = -1; + } } rcu_read_unlock (); - if (ret) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_HANDSHAKE_REQ_REJECTED, "Rejecting management " |