diff options
author | Kaushal M <kaushal@redhat.com> | 2012-04-19 13:17:49 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-20 09:32:17 -0700 |
commit | e2216fbc37831f76039cae77bf724550827daa0f (patch) | |
tree | 86621048b0f18383ed16a75fa64174663c623d1f /cli/src/cli-cmd-parser.c | |
parent | 3a26a7324128aed8181959b995d09ffc19ec2265 (diff) |
cli: Strip whitespace from "volume set" option values
Strips the whitespace from options values before sending to glusterd.
This prevents options containing whitespace to be written to the volfiles which
would cause the volfile parser to fail.
Change-Id: I46faee7b0853141fa102d06bb067c7ab499a2f6e
BUG: 813937
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3192
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 2aba56b9b3d..aef13a77df9 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -688,6 +688,10 @@ cli_cmd_volume_set_parse (const char **words, int wordcount, dict_t **options) count++; + ret = gf_strip_whitespace (value, strlen (value)); + if (ret == -1) + goto out; + sprintf (str, "key%d", count); ret = dict_set_str (dict, str, key); if (ret) |