Blob Blame History Raw
From 1232b4c764a9b0f6d8789359048325ff38bf2e07 Mon Sep 17 00:00:00 2001
From: Manikandan Selvaganesh <mselvaga@redhat.com>
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 <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>

Change-Id: I2c3d34bfdc7b924d00b11f8649b73a5069cbc2dc
BUG: 1065651
Signed-off-by: Manikandan Selvaganesh <mselvaga@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/55300
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
---
 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