From 75046f96c40679da8dae20a3a0b2f6a2b4c34517 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Thu, 10 Mar 2016 16:43:08 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/13669 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Kaushal M Reviewed-on: http://review.gluster.org/13821 --- cli/src/cli-cmd-parser.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 1a4c2f59f1a..8fb78230935 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -12,6 +12,7 @@ #include #include #include +#include #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; -- cgit