summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2016-03-10 16:43:08 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-03-24 02:23:16 -0700
commit75046f96c40679da8dae20a3a0b2f6a2b4c34517 (patch)
treea3efe482aad5f2bd9d700b023c645625751c703f /cli
parent12861b75dcc2319067cabc903e688b4ceb4763fe (diff)
cli: Do not remove whitespace if key is user.* in volume set
Backport of http://review.gluster.org/#/c/13669 setting any user.* option can have multiple words in the key and hence skip the process of trimming whitespaces. Change-Id: Ia295428d7cda55e5470fef668325bea497f2333d BUG: 1320821 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> Reviewed-on: http://review.gluster.org/13821
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 1a4c2f5..8fb7823 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>
#ifndef _CONFIG_H
#define _CONFIG_H
@@ -1520,9 +1521,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;