From 60347526d9611035da0e56d55d4814f51cda9367 Mon Sep 17 00:00:00 2001 From: Gaurav Yadav Date: Tue, 21 Feb 2017 22:35:47 +0530 Subject: glusterd : cluster.brick-multiplex validation is missing while setting it Currently glusterd allow setting all values while setting cluster.brick-multiplex option. Validation of allowed options is missing. With this patch glusterd will validate the values given while setting cluster.brick-multiplex. Change-Id: I938fb16b8f5faa9d31326373cd18632b8aa7ebab BUG: 1425288 Signed-off-by: Gaurav Yadav Reviewed-on: https://review.gluster.org/16704 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- xlators/mgmt/glusterd/src/glusterd-volume-set.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-set.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 349fd54ae2b..5cb4b6c9702 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -902,7 +902,7 @@ out: static int -validate_worm (glusterd_volinfo_t *volinfo, dict_t *dict, char *key, +validate_boolean (glusterd_volinfo_t *volinfo, dict_t *dict, char *key, char *value, char **op_errstr) { xlator_t *this = NULL; @@ -2461,7 +2461,7 @@ struct volopt_map_entry glusterd_volopt_map[] = { .voltype = "features/worm", .option = "worm", .value = "off", - .validate_fn = validate_worm, + .validate_fn = validate_boolean, .op_version = 2, .flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_XLATOR_OPT }, @@ -2469,7 +2469,7 @@ struct volopt_map_entry glusterd_volopt_map[] = { .voltype = "features/worm", .option = "worm-file-level", .value = "off", - .validate_fn = validate_worm, + .validate_fn = validate_boolean, .op_version = GD_OP_VERSION_3_8_0, .flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_XLATOR_OPT }, @@ -3150,7 +3150,8 @@ struct volopt_map_entry glusterd_volopt_map[] = { { .key = GLUSTERD_BRICK_MULTIPLEX_KEY, .voltype = "mgmt/glusterd", .value = "off", - .op_version = GD_OP_VERSION_3_10_0 + .op_version = GD_OP_VERSION_3_10_0, + .validate_fn = validate_boolean }, { .key = NULL } -- cgit