summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 36f710f0385..b53b1ee648b 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -240,8 +240,14 @@ cli_cmd_volume_create_parse (const char **words, int wordcount, dict_t **options
goto out;
for (i = 0; i < strlen (volname); i++)
- if (!isalnum (volname[i]) && (volname[i] != '_') && (volname[i] != '-'))
+ if (!isalnum (volname[i]) && (volname[i] != '_') &&
+ (volname[i] != '-')) {
+ cli_err ("Volume name should not contain \"%c\""
+ " character.\nVolume names can only"
+ "contain alphanumeric, '-' and '_' "
+ "characters.",volname[i]);
goto out;
+ }
}
if (wordcount < 4) {
@@ -559,8 +565,14 @@ cli_cmd_quota_parse (const char **words, int wordcount, dict_t **options)
goto out;
for (i = 0; i < strlen (volname); i++)
- if (!isalnum (volname[i]) && (volname[i] != '_') && (volname[i] != '-'))
+ if (!isalnum (volname[i]) && (volname[i] != '_') &&
+ (volname[i] != '-')) {
+ cli_err ("Volume name should not contain \"%c\""
+ " character.\nVolume names can only"
+ "contain alphanumeric, '-' and '_' "
+ "characters.",volname[i]);
goto out;
+ }
}
ret = dict_set_str (dict, "volname", volname);