|
|
d1681e |
From 0652899ce703542fc7fd676f3fd80748395d7094 Mon Sep 17 00:00:00 2001
|
|
|
d1681e |
From: Sanoj Unnikrishnan <sunnikri@redhat.com>
|
|
|
d1681e |
Date: Wed, 9 May 2018 13:43:48 +0530
|
|
|
d1681e |
Subject: [PATCH 259/260] Quota: Turn on ssl for crawler clients if needed
|
|
|
d1681e |
|
|
|
d1681e |
Problem: Quota uses per brick client generated by
|
|
|
d1681e |
glusterd_generate_client_per_brick_volfile to crawl the
|
|
|
d1681e |
individual bricks. These clients were not being configured
|
|
|
d1681e |
with ssl if volume has client.ssl turned on.
|
|
|
d1681e |
|
|
|
d1681e |
Solution: turn on client.ssl if the volume has client.ssl
|
|
|
d1681e |
option set to on.
|
|
|
d1681e |
|
|
|
d1681e |
Upstream Reference:
|
|
|
d1681e |
> Change-Id: Id3a13d5110c4376d734480c42da1ce6844cc8240
|
|
|
d1681e |
> fixes: bz#1575858
|
|
|
d1681e |
> Reviewed on: https://review.gluster.org/#/c/19978/
|
|
|
d1681e |
|
|
|
d1681e |
BUG: 1557551
|
|
|
d1681e |
Change-Id: Id3a13d5110c4376d734480c42da1ce6844cc8240
|
|
|
d1681e |
Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
|
|
|
d1681e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/138158
|
|
|
d1681e |
Reviewed-by: Hari Gowtham Gopal <hgowtham@redhat.com>
|
|
|
d1681e |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
d1681e |
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
|
|
d1681e |
---
|
|
|
d1681e |
xlators/mgmt/glusterd/src/glusterd-volgen.c | 21 ++++++++++++++++++++-
|
|
|
d1681e |
1 file changed, 20 insertions(+), 1 deletion(-)
|
|
|
d1681e |
|
|
|
d1681e |
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
|
|
d1681e |
index 3926bd3..3d8ad77 100644
|
|
|
d1681e |
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
|
|
d1681e |
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
|
|
d1681e |
@@ -5726,6 +5726,8 @@ glusterd_generate_client_per_brick_volfile (glusterd_volinfo_t *volinfo)
|
|
|
d1681e |
dict_t *dict = NULL;
|
|
|
d1681e |
xlator_t *xl = NULL;
|
|
|
d1681e |
int ret = -1;
|
|
|
d1681e |
+ char *ssl_str = NULL;
|
|
|
d1681e |
+ gf_boolean_t ssl_bool = _gf_false;
|
|
|
d1681e |
|
|
|
d1681e |
dict = dict_new ();
|
|
|
d1681e |
if (!dict)
|
|
|
d1681e |
@@ -5733,7 +5735,22 @@ glusterd_generate_client_per_brick_volfile (glusterd_volinfo_t *volinfo)
|
|
|
d1681e |
|
|
|
d1681e |
ret = dict_set_uint32 (dict, "trusted-client", GF_CLIENT_TRUSTED);
|
|
|
d1681e |
if (ret)
|
|
|
d1681e |
- goto out;
|
|
|
d1681e |
+ goto free_dict;
|
|
|
d1681e |
+
|
|
|
d1681e |
+ if (dict_get_str(volinfo->dict, "client.ssl", &ssl_str) == 0) {
|
|
|
d1681e |
+ if (gf_string2boolean(ssl_str, &ssl_bool) == 0) {
|
|
|
d1681e |
+ if (ssl_bool) {
|
|
|
d1681e |
+ if (dict_set_dynstr_with_alloc(dict,
|
|
|
d1681e |
+ "client.ssl", "on") != 0) {
|
|
|
d1681e |
+ ret = -1;
|
|
|
d1681e |
+ goto free_dict;
|
|
|
d1681e |
+ }
|
|
|
d1681e |
+ }
|
|
|
d1681e |
+ } else {
|
|
|
d1681e |
+ ret = -1;
|
|
|
d1681e |
+ goto free_dict;
|
|
|
d1681e |
+ }
|
|
|
d1681e |
+ }
|
|
|
d1681e |
|
|
|
d1681e |
cds_list_for_each_entry (brick, &volinfo->bricks, brick_list) {
|
|
|
d1681e |
xl = volgen_graph_build_client (&graph, volinfo,
|
|
|
d1681e |
@@ -5760,6 +5777,8 @@ out:
|
|
|
d1681e |
if (ret)
|
|
|
d1681e |
volgen_graph_free (&graph);
|
|
|
d1681e |
|
|
|
d1681e |
+free_dict:
|
|
|
d1681e |
+
|
|
|
d1681e |
if (dict)
|
|
|
d1681e |
dict_unref (dict);
|
|
|
d1681e |
|
|
|
d1681e |
--
|
|
|
d1681e |
1.8.3.1
|
|
|
d1681e |
|