summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2013-03-26 14:15:58 +0530
committerVijay Bellur <vbellur@redhat.com>2013-09-07 07:53:12 -0700
commit62ad7e3aa88d2490606b15da7d14fab6675ec805 (patch)
tree4e0ea66a6e715cae0e5c68122e652db247dcbf0a /rpc
parent1ad4d0457da4366028affffddb6fa1d3725ef22e (diff)
rpc: disable root-squash dynamically upon volume set command
Change-Id: I2ba9ca339ffbe07cb74833165a46a941225b623d BUG: 927616 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/4722 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Reviewed-on: http://review.gluster.org/5847
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpcsvc-auth.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc-auth.c b/rpc/rpc-lib/src/rpcsvc-auth.c
index 907ae1ec9af..04b66091f73 100644
--- a/rpc/rpc-lib/src/rpcsvc-auth.c
+++ b/rpc/rpc-lib/src/rpcsvc-auth.c
@@ -206,11 +206,16 @@ rpcsvc_set_allow_insecure (rpcsvc_t *svc, dict_t *options)
int
rpcsvc_set_root_squash (rpcsvc_t *svc, dict_t *options)
{
+ int ret = -1;
+
GF_ASSERT (svc);
GF_ASSERT (options);
- if (dict_get_str_boolean (options, "root-squash", 0))
- svc->root_squash = _gf_true;
+ ret = dict_get_str_boolean (options, "root-squash", 0);
+ if (ret != -1)
+ svc->root_squash = ret;
+ else
+ svc->root_squash = _gf_false;
if (svc->root_squash)
gf_log (GF_RPCSVC, GF_LOG_DEBUG, "root squashing enabled ");