diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2012-07-24 12:44:11 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-07-29 14:20:38 -0700 |
commit | 86e326921e29bc39f2ea4efe6a1882199de18a79 (patch) | |
tree | a3d24f0108b7ded371e8d3a64616db200be24501 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | c9b96e26a3bab09a4146b2bec57a57c69b9aa8b7 (diff) |
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 <kparthas@redhat.com>
Reviewed-on: http://review.gluster.com/3715
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 28 |
1 files changed, 11 insertions, 17 deletions
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) |