From 06c3cf61249e05ae1212a43d5fc1db57bad5f718 Mon Sep 17 00:00:00 2001 From: Manikandan Selvaganesh Date: Wed, 22 Jul 2015 15:12:36 +0530 Subject: quota : checking for absolute path in quota command Currently, if absolute path is not entered in "gluster volume quota list ", it just shows the header (Path Hard-limit Soft-limit...) instead of showing an error message. With this patch, it shows an error to enter the absolute path. Change-Id: I2c3d34bfdc7b924d00b11f8649b73a5069cbc2dc BUG: 1245558 Signed-off-by: Manikandan Selvaganesh Reviewed-on: http://review.gluster.org/11738 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Vijaikumar Mallikarjuna Reviewed-by: Raghavendra G --- cli/src/cli-cmd-parser.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 6d84fec099c..393af341635 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1171,6 +1171,12 @@ cli_cmd_quota_parse (const char **words, int wordcount, dict_t **options) type = GF_QUOTA_OPTION_TYPE_LIST; + if (words[4] && words[4][0] != '/') { + cli_err ("Please enter absolute path"); + ret = -1; + goto out; + } + i = 4; while (i < wordcount) { snprintf (key, 20, "path%d", i-4); -- cgit