summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-lib/src/rpcsvc-auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/rpc-lib/src/rpcsvc-auth.c')
-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 907ae1e..04b6609 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 ");