summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2016-03-10 16:43:08 +0530
committerKaushal M <kaushal@redhat.com>2016-03-23 21:10:03 -0700
commitf2d51d6546976731fed5fd165bf57acac3fb0180 (patch)
treee690a5fd4ada62138a45aa2e114b76010cc1672c /cli
parent7fb3abaeae763b99ef387804b46943051ac6cbbc (diff)
cli: Do not remove whitespace if key is user.* in volume set
setting any user.* option can have multiple words in the key and hence skip the process of trimming whitespaces. Change-Id: Ia295428d7cda55e5470fef668325bea497f2333d BUG: 1316499 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/13669 Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index e37408ddb37..a3d46b60231 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -12,6 +12,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <pthread.h>
+#include <fnmatch.h>
#include "cli.h"
#include "cli-cmd.h"
@@ -1510,9 +1511,11 @@ cli_cmd_volume_set_parse (struct cli_state *state, const char **words,
count++;
- ret = gf_strip_whitespace (value, strlen (value));
- if (ret == -1)
- goto out;
+ if (fnmatch ("user.*", key, FNM_NOESCAPE) != 0) {
+ ret = gf_strip_whitespace (value, strlen (value));
+ if (ret == -1)
+ goto out;
+ }
if (strlen (value) == 0) {
ret = -1;