diff options
| author | Atin Mukherjee <amukherj@redhat.com> | 2017-05-22 20:23:06 +0530 | 
|---|---|---|
| committer | Raghavendra Talur <rtalur@redhat.com> | 2017-05-30 13:35:38 +0000 | 
| commit | 541e6a0079e50aa36e37270a91d86fccb2467ee4 (patch) | |
| tree | 7e707e73e806edc95c8bcfa335951b3b4ea640f9 | |
| parent | 29ce31a5080a63690cbaf5dc917bfa9fcb19e8aa (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: 1455182
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://review.gluster.org/17386
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: Raghavendra Talur <rtalur@redhat.com>
| -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 96d39f03007..c59719a814a 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 "  | 
