summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanoj Unnikrishnan <sunnikri@redhat.com>2018-05-08 11:41:11 +0530
committerAmar Tumballi <amarts@redhat.com>2018-05-09 07:04:20 +0000
commit8d1335af8024e3622eaab31520cc2b8a70c0f212 (patch)
tree328483be1d82c0e713aa09fb6c5afb8230439bbd
parent2d3b44641dc7820043eae37572292b7b3cc26625 (diff)
Quota: Turn on ssl for crawler clients if needed
Problem: Quota uses per brick client generated by glusterd_generate_client_per_brick_volfile to crawl the individual bricks. These clients were not being configured with ssl if volume has client.ssl turned on. Solution: turn on client.ssl if the volume has client.ssl option set to on. Change-Id: Id3a13d5110c4376d734480c42da1ce6844cc8240 fixes: bz#1575858 Signed-off-by: Sanoj Unnikrishnan <sunnikri@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index daf69f90cc0..fbb8013931b 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -6013,6 +6013,8 @@ glusterd_generate_client_per_brick_volfile (glusterd_volinfo_t *volinfo)
dict_t *dict = NULL;
xlator_t *xl = NULL;
int ret = -1;
+ char *ssl_str = NULL;
+ gf_boolean_t ssl_bool = _gf_false;
dict = dict_new ();
if (!dict)
@@ -6020,7 +6022,22 @@ glusterd_generate_client_per_brick_volfile (glusterd_volinfo_t *volinfo)
ret = dict_set_uint32 (dict, "trusted-client", GF_CLIENT_TRUSTED);
if (ret)
- goto out;
+ goto free_dict;
+
+ if (dict_get_str(volinfo->dict, "client.ssl", &ssl_str) == 0) {
+ if (gf_string2boolean(ssl_str, &ssl_bool) == 0) {
+ if (ssl_bool) {
+ if (dict_set_dynstr_with_alloc(dict,
+ "client.ssl", "on") != 0) {
+ ret = -1;
+ goto free_dict;
+ }
+ }
+ } else {
+ ret = -1;
+ goto free_dict;
+ }
+ }
cds_list_for_each_entry (brick, &volinfo->bricks, brick_list) {
xl = volgen_graph_build_client (&graph, volinfo,
@@ -6048,6 +6065,8 @@ out:
if (ret)
volgen_graph_free (&graph);
+free_dict:
+
if (dict)
dict_unref (dict);