diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 18b628ae18b..b29583f21a0 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -168,6 +168,8 @@ cli_cmd_volume_create_parse (const char **words, int wordcount, dict_t **options char *bricks = NULL; int32_t brick_count = 0; char *opwords[] = { "replica", "stripe", "transport", NULL }; + char *invalid_volnames[] = {"volume", "type", "subvolumes", "option", + "end-volume", "all", NULL}; char *w = NULL; int op_count = 0; int32_t replica_count = 1; @@ -193,9 +195,12 @@ cli_cmd_volume_create_parse (const char **words, int wordcount, dict_t **options if (volname[0] == '-') goto out; - if (!strcmp (volname, "all")) { - cli_err ("\"all\" cannot be the name of a volume."); - goto out; + for (i = 0; invalid_volnames[i]; i++) { + if (!strcmp (volname, invalid_volnames[i])) { + cli_err ("\"%s\" cannot be the name of a volume.", + volname); + goto out; + } } if (strchr (volname, '/')) |