summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-05-22 20:23:06 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-05-25 14:50:21 +0000
commit7f280b6236154c72f50bcd3d7b291ca483da7d09 (patch)
tree741c9c3dc52496195302c530600ed13687c0b2bb
parent71752f1bde9e8ad7a71670c885279f91ff951a1b (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 >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> >(cherry picked from commit b1fbc695a63801a3a2c62738fd6660388123724a) Change-Id: I2c30bf0490c31d1418b31d555e7758696e79409f BUG: 1455177 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/17385 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handshake.c27
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 "