From 86e326921e29bc39f2ea4efe6a1882199de18a79 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 24 Jul 2012 12:44:11 +0530 Subject: glusterd: Persisted hooks friendly user.* keys - Fixed validation of user.* keys in presence of multiple key, value pairs in a single volume set command Change-Id: I5b96de2d009fbc79772121308d9b4c0a552bac52 BUG: 825902 Signed-off-by: Krishnan Parthasarathi Reviewed-on: http://review.gluster.com/3715 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index d6855b9043b..d4697434895 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -416,10 +416,8 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr) goto out; } - if (is_key_glusterd_hooks_friendly (this, volname, key)) { - ret = 0; - goto out; - } + if (is_key_glusterd_hooks_friendly (key)) + continue; exists = glusterd_check_option_exists (key, &key_fixed); if (exists == -1) { @@ -444,8 +442,7 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr) if (key_fixed) key = key_fixed; - ret = glusterd_check_globaloption (key); - if (ret) + if (glusterd_check_globaloption (key)) global_opt = _gf_true; ret = dict_set_str (val_dict, key, value); @@ -1111,20 +1108,17 @@ glusterd_op_set_volume (dict_t *dict) goto out; } - if (is_key_glusterd_hooks_friendly (this, volname, key)) { - ret = 0; - goto out; - } + if (!is_key_glusterd_hooks_friendly (key)) { + ret = glusterd_check_option_exists (key, &key_fixed); + GF_ASSERT (ret); + if (ret <= 0) { + key_fixed = NULL; + goto out; + } - ret = glusterd_check_option_exists (key, &key_fixed); - GF_ASSERT (ret); - if (ret == -1) { - key_fixed = NULL; - goto out; } - ret = glusterd_check_globaloption (key); - if (ret) + if (glusterd_check_globaloption (key)) global_opt = _gf_true; if (!global_opt) -- cgit