From d5c3024f9fb4e1671d8e0a969934350bb08e2db9 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 26 Mar 2013 14:15:58 +0530 Subject: rpc: disable root-squash dynamically upon volume set command Change-Id: I2ba9ca339ffbe07cb74833165a46a941225b623d BUG: 927616 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/4722 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- rpc/rpc-lib/src/rpcsvc-auth.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'rpc/rpc-lib') diff --git a/rpc/rpc-lib/src/rpcsvc-auth.c b/rpc/rpc-lib/src/rpcsvc-auth.c index 907ae1ec9..04b66091f 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 "); -- cgit