summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-parser.c
diff options
context:
space:
mode:
authorManikandan Selvaganesh <mselvaga@redhat.com>2015-07-22 15:12:36 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-08-12 04:47:37 -0700
commit06c3cf61249e05ae1212a43d5fc1db57bad5f718 (patch)
tree9db029c01692779cdc81e2ed9e7add51809d954b /cli/src/cli-cmd-parser.c
parentc0a4171da69537c1947b68014e5fb732b531ecd9 (diff)
downloadglusterfs-06c3cf61249e05ae1212a43d5fc1db57bad5f718.tar.gz
glusterfs-06c3cf61249e05ae1212a43d5fc1db57bad5f718.tar.xz
glusterfs-06c3cf61249e05ae1212a43d5fc1db57bad5f718.zip
quota : checking for absolute path in quota command
Currently, if absolute path is not entered in "gluster volume quota <vol-name> list <path>", 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 <mselvaga@redhat.com> Reviewed-on: http://review.gluster.org/11738 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r--cli/src/cli-cmd-parser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 6d84fec099..393af34163 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);