From ead92558ee8ec71442b2fa2da1a0df197ee78467 Mon Sep 17 00:00:00 2001 From: Sachidananda Date: Tue, 17 Aug 2010 01:46:43 +0000 Subject: xlators/nfs: rpcsvc-auth.c - clean up dead assignments. Signed-off-by: Sachidananda Urs Signed-off-by: Anand V. Avati BUG: 1119 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1119 --- xlators/nfs/lib/src/rpcsvc-auth.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'xlators/nfs/lib/src') diff --git a/xlators/nfs/lib/src/rpcsvc-auth.c b/xlators/nfs/lib/src/rpcsvc-auth.c index b3e2e36a3b0..7ff2d793db6 100644 --- a/xlators/nfs/lib/src/rpcsvc-auth.c +++ b/xlators/nfs/lib/src/rpcsvc-auth.c @@ -72,9 +72,8 @@ nfs_rpcsvc_auth_add_initers (rpcsvc_t *svc) goto err; } - ret = 0; err: - return 0; + return ret; } @@ -131,11 +130,23 @@ nfs_rpcsvc_auth_init_auths (rpcsvc_t *svc, dict_t *options) * it by default. This is a globally default rule, the user is still * allowed to disable the two for particular subvolumes. */ - if (!dict_get (options, "rpc-auth.auth-null")) + if (!dict_get (options, "rpc-auth.auth-null")) { ret = dict_set_dynstr (options, "rpc-auth.auth-null", "on"); + if (ret < 0) { + gf_log (GF_RPCSVC, GF_LOG_ERROR, + "Failed to set dict value."); + goto err; + } + } - if (!dict_get (options, "rpc-auth.auth-unix")) + if (!dict_get (options, "rpc-auth.auth-unix")) { ret = dict_set_dynstr (options, "rpc-auth.auth-unix", "on"); + if (ret < 0) { + gf_log (GF_RPCSVC, GF_LOG_ERROR, + "Failed to set dict value."); + goto err; + } + } list_for_each_entry_safe (auth, tmp, &svc->authschemes, authlist) { ret = nfs_rpcsvc_auth_init_auth (svc, options, auth); @@ -177,7 +188,6 @@ out: rpcsvc_auth_t * __nfs_rpcsvc_auth_get_handler (rpcsvc_request_t *req) { - int ret = -1; struct rpcsvc_auth_list *auth = NULL; struct rpcsvc_auth_list *tmp = NULL; rpcsvc_t *svc = NULL; @@ -188,7 +198,6 @@ __nfs_rpcsvc_auth_get_handler (rpcsvc_request_t *req) svc = nfs_rpcsvc_request_service (req); if (list_empty (&svc->authschemes)) { gf_log (GF_RPCSVC, GF_LOG_WARNING, "No authentication!"); - ret = 0; goto err; } -- cgit