summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c10
-rw-r--r--cli/src/cli-cmd-volume.c2
2 files changed, 9 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index e7f41fa7203..a41c0800ac1 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -236,8 +236,11 @@ cli_cmd_volume_create_parse (const char **words, int wordcount, dict_t **options
if (strchr (volname, '/'))
goto out;
- if (strlen (volname) > 512)
+ if (strlen (volname) > GD_VOLUME_NAME_MAX) {
+ cli_err("Volume name exceeds %d characters.",
+ GD_VOLUME_NAME_MAX);
goto out;
+ }
for (i = 0; i < strlen (volname); i++)
if (!isalnum (volname[i]) && (volname[i] != '_') &&
@@ -561,8 +564,11 @@ cli_cmd_quota_parse (const char **words, int wordcount, dict_t **options)
if (strchr (volname, '/'))
goto out;
- if (strlen (volname) > 512)
+ if (strlen (volname) > GD_VOLUME_NAME_MAX) {
+ cli_err("Volname can not exceed %d characters.",
+ GD_VOLUME_NAME_MAX);
goto out;
+ }
for (i = 0; i < strlen (volname); i++)
if (!isalnum (volname[i]) && (volname[i] != '_') &&
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 83b923e360a..6072fcc5193 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -65,7 +65,7 @@ cli_cmd_volume_info_cbk (struct cli_state *state, struct cli_cmd_word *word,
} else if (wordcount == 3) {
ctx.flags = GF_CLI_GET_VOLUME;
ctx.volname = (char *)words[2];
- if (strlen (ctx.volname) > 1024) {
+ if (strlen (ctx.volname) > GD_VOLUME_NAME_MAX) {
cli_out ("Invalid volume name");
goto out;
}