From 1232b4c764a9b0f6d8789359048325ff38bf2e07 Mon Sep 17 00:00:00 2001 From: Manikandan Selvaganesh Date: Wed, 22 Jul 2015 15:12:36 +0530 Subject: [PATCH 274/279] 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 Change-Id: I2c3d34bfdc7b924d00b11f8649b73a5069cbc2dc BUG: 1065651 Signed-off-by: Manikandan Selvaganesh Reviewed-on: https://code.engineering.redhat.com/gerrit/55300 Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- cli/src/cli-cmd-parser.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 8f3396f..0f7b5be 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); -- 1.7.1