diff options
author | Kaushal M <kaushal@redhat.com> | 2014-06-19 15:31:46 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-24 00:00:13 -0700 |
commit | b0f98446d5b465c3fc88569396fe3c6b5793aed5 (patch) | |
tree | e0c18c46c9d346092fb6eb83ce774fd8303f25be /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | c4440ab8c7417a3bcaadf1cb150476d5ff6a1325 (diff) |
glusterd: Authenticate management handshake requests
Backport of
371bb42 glusterd: Authenticate management handshake requests
from master.
Management handshake requests, which are used to validate op-version
supported by the peers, are now only allowed if,
- the glusterd doesn't have any other peer, or
- the request was sent by another peer.
This prevents the op-version of a peer being changed because of a
connection attempt by an invalid peer.
BUG: 1144978
Change-Id: I5a909dad37e9873efe8b75dad41b7af71ce91c3d
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/8819
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 50a99643616..bee17e50c51 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -13620,3 +13620,18 @@ out: GF_FREE (mnt_pt); return ret; } + + +gf_boolean_t +glusterd_have_peers () +{ + xlator_t *this = NULL; + glusterd_conf_t *conf = NULL; + + this = THIS; + GF_ASSERT (this); + conf = this->private; + GF_ASSERT (conf); + + return !list_empty (&conf->peers); +}
\ No newline at end of file |