diff options
| -rw-r--r-- | cli/src/cli-cmd-parser.c | 16 | ||||
| -rwxr-xr-x | tests/bugs/bug-921215.t | 13 | 
2 files changed, 27 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); diff --git a/tests/bugs/bug-921215.t b/tests/bugs/bug-921215.t new file mode 100755 index 00000000000..344b568591c --- /dev/null +++ b/tests/bugs/bug-921215.t @@ -0,0 +1,13 @@ +#!/bin/bash + +# This is test case for bug no 921215 "Can not create volume with a . in the name" + +. $(dirname $0)/../include.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST ! $CLI volume create $V0.temp replica 2 $H0:$B0/${V0}0 $H0:$B0/${V0}1 + +cleanup;  | 
