summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
diff options
context:
space:
mode:
authorAjeet Jha <ajha@redhat.com>2013-09-23 13:42:21 +0530
committerAnand Avati <avati@redhat.com>2013-10-03 21:25:28 -0700
commita65d64e89c96b52b9805b63afbbc3e7b67dbc3ad (patch)
tree604ec8be600c1c7540fe073a07e3828587c66d0d /xlators/mgmt/glusterd/src/glusterd-geo-rep.c
parent7dba6f9b556288a95d6ca7e9c3222d14cae3def5 (diff)
glusterd: Validating invalid log-level under geo-rep config options.
Change-Id: I8ff6b48ef41fd6e9ea68c42dfb9878f8a08ed627 BUG: 1010874 Signed-off-by: Ajeet Jha <ajha@redhat.com> Reviewed-on: http://review.gluster.org/5989 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 8bdb9457462..5786694bdf9 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -42,12 +42,19 @@ glusterd_gsync_read_frm_status (char *path, char *buf, size_t blen);
struct gsync_config_opt_vals_ gsync_confopt_vals[] = {
{.op_name = "change_detector",
.no_of_pos_vals = 2,
+ .case_sensitive = _gf_true,
.values = {"xsync", "changelog"},
},
{.op_name = "special_sync_mode",
.no_of_pos_vals = 2,
+ .case_sensitive = _gf_true,
.values = {"partial", "recover"}
},
+ {.op_name = "log-level",
+ .no_of_pos_vals = 5,
+ .case_sensitive = _gf_false,
+ .values = {"critical", "error", "warning", "info", "debug"}
+ },
{.op_name = NULL,
},
};
@@ -894,8 +901,13 @@ gsync_verify_config_options (dict_t *dict, char **op_errstr, char *volname)
if (op_match) {
val_match = _gf_false;
for (i = 0; i < conf_vals->no_of_pos_vals; i++) {
- if (!strcmp (conf_vals->values[i], op_value))
- val_match = _gf_true;
+ if(conf_vals->case_sensitive){
+ if (!strcmp (conf_vals->values[i], op_value))
+ val_match = _gf_true;
+ } else {
+ if (!strcasecmp (conf_vals->values[i], op_value))
+ val_match = _gf_true;
+ }
}
if (!val_match) {