path: root/cli
diff options
authorRavishankar N <>2016-06-16 10:21:53 +0530
committerAtin Mukherjee <>2016-06-27 23:37:07 -0700
commit984ebffd03aaf6e1da9981b804d5a368e56150ee (patch)
tree77deb5a0af24fb862ae098ee923553ea09d9043e /cli
parentd22305998f99bb9a5c89b5639ca95b3689881510 (diff)
cli: fix crash in arbiter keyword parsing
Backport of A negative case like `gluster volume create volname arbiter 3 /bricks{1..3}` must not crash. 'arbiter' keyword is valid only for (3 way) replica volumes. The .t that is added will crash and create a core *without* the fix when run but will still pass all TESTs. Since the regression framework fails the .t if it creates a core, we can consider it a valid test 'that fails without the fix'. Change-Id: Ie2d7ced66025ea3617d30f6f823b22401e6d2fde BUG: 1348056 Signed-off-by: Ravishankar N <> (cherry picked from commit b5c492dfea2d2e2075aa88d7153fba57b06e739d) Reviewed-on: Smoke: Gluster Build System <> NetBSD-regression: NetBSD Build System <> CentOS-regression: Gluster Build System <> Reviewed-by: Atin Mukherjee <>
Diffstat (limited to 'cli')
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 206acdd..0adc956 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -633,6 +633,11 @@ cli_cmd_volume_create_parse (struct cli_state *state, const char **words,
goto out;
index += ret;
+ } else if ((strcmp (w, "arbiter") == 0)) {
+ cli_err ("arbiter option must be preceded by replica "
+ "option.");
+ ret = -1;
+ goto out;
} else {
GF_ASSERT (!"opword mismatch");
ret = -1;