diff options
author | Pranith K <pranithk@gluster.com> | 2011-03-26 11:40:05 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-29 05:32:36 -0700 |
commit | ad278612cd464503e421211a9e78afc7e43f43c2 (patch) | |
tree | b18f0b46f2738cecd4f8be0168108a6488658eab /rpc/rpc-lib/src/rpcsvc-auth.c | |
parent | 9c0d73d37bd7fa2f342215362d0d8ab88db5ee28 (diff) |
rpc: Provide an option to allow insecure ports
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 2582 (allow option to accept messages from insecure ports)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2582
Diffstat (limited to 'rpc/rpc-lib/src/rpcsvc-auth.c')
-rw-r--r-- | rpc/rpc-lib/src/rpcsvc-auth.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc-auth.c b/rpc/rpc-lib/src/rpcsvc-auth.c index 5cfa255ba95..be4004cc5f8 100644 --- a/rpc/rpc-lib/src/rpcsvc-auth.c +++ b/rpc/rpc-lib/src/rpcsvc-auth.c @@ -176,6 +176,32 @@ err: } int +rpcsvc_set_allow_insecure (rpcsvc_t *svc, dict_t *options) +{ + int ret = -1; + char *allow_insecure_str = NULL; + gf_boolean_t is_allow_insecure = _gf_false; + + GF_ASSERT (svc); + GF_ASSERT (options); + + ret = dict_get_str (options, "rpc-auth-allow-insecure", + &allow_insecure_str); + if (0 == ret) { + ret = gf_string2boolean (allow_insecure_str, + &is_allow_insecure); + if (0 == ret) { + if (_gf_true == is_allow_insecure) + svc->allow_insecure = 1; + else + svc->allow_insecure = 0; + } + } + + return 0; +} + +int rpcsvc_auth_init (rpcsvc_t *svc, dict_t *options) { int ret = -1; @@ -183,6 +209,7 @@ rpcsvc_auth_init (rpcsvc_t *svc, dict_t *options) if ((!svc) || (!options)) return -1; + (void) rpcsvc_set_allow_insecure (svc, options); ret = rpcsvc_auth_add_initers (svc); if (ret == -1) { gf_log (GF_RPCSVC, GF_LOG_ERROR, "Failed to add initers"); |