Skip to content

Instantly share code, notes, and snippets.

@awheeler
Last active December 14, 2015 21:49
Show Gist options
  • Save awheeler/5153921 to your computer and use it in GitHub Desktop.
Save awheeler/5153921 to your computer and use it in GitHub Desktop.
Add '.' support for glusterfs volume names, and provide additional error notification.
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index c09aa62..7e55757 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -211,7 +211,9 @@ 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] != '-') && (volname[i] != '.')) {
+ cli_err ("\"%s\" contains one or more invalid characters.",
+ volname);
goto out;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment