From ae6cf9a1cbc3072ff88728726f7ba16fe7d338a5 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. Backport of http://review.gluster.org/#/c/11738/ Cherry picked from commit 06c3cf61249e05ae1212a43d5fc1db57bad5f718 > 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 Change-Id: I2c3d34bfdc7b924d00b11f8649b73a5069cbc2dc BUG: 1252873 Signed-off-by: Manikandan Selvaganesh Reviewed-on: http://review.gluster.org/11899 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Raghavendra G --- cli/src/cli-cmd-parser.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index c0755cf6228..4b99f6a4288 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1176,6 +1176,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