summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2010-09-01 16:30:32 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-09-08 09:36:22 -0400
commit87f2bb60510f31fec012d126411f09a99c72140e (patch)
tree48cce3b9f98265a2297c3a6f8be6cd55ed1a3855
parent88aeed9a31b734a92630d5e881c960c5f77ba0ce (diff)
downloadsssd-87f2bb60510f31fec012d126411f09a99c72140e.tar.gz
sssd-87f2bb60510f31fec012d126411f09a99c72140e.tar.bz2
sssd-87f2bb60510f31fec012d126411f09a99c72140e.zip
Dead assignments cleanup in providers code
Dead assignments were deleted. Also prototype of function sdap_access_decide_offline() has been changed, since its return code was never used. Ticket: #586
-rw-r--r--src/providers/child_common.c4
-rw-r--r--src/providers/data_provider_opts.c1
-rw-r--r--src/providers/krb5/krb5_child.c1
-rw-r--r--src/providers/ldap/ldap_id_enum.c3
-rw-r--r--src/providers/ldap/sdap_access.c18
-rw-r--r--src/providers/proxy/proxy_id.c2
6 files changed, 9 insertions, 20 deletions
diff --git a/src/providers/child_common.c b/src/providers/child_common.c
index a242338a..16618c78 100644
--- a/src/providers/child_common.c
+++ b/src/providers/child_common.c
@@ -493,14 +493,14 @@ void child_cleanup(int readfd, int writefd)
ret = close(readfd);
if (ret != EOK) {
ret = errno;
- DEBUG(1, ("close failed [%d][%s].\n", errno, strerror(errno)));
+ DEBUG(1, ("close failed [%d][%s].\n", ret, strerror(ret)));
}
}
if (writefd != -1) {
ret = close(writefd);
if (ret != EOK) {
ret = errno;
- DEBUG(1, ("close failed [%d][%s].\n", errno, strerror(errno)));
+ DEBUG(1, ("close failed [%d][%s].\n", ret, strerror(ret)));
}
}
}
diff --git a/src/providers/data_provider_opts.c b/src/providers/data_provider_opts.c
index 3433c4d9..3fdbb055 100644
--- a/src/providers/data_provider_opts.c
+++ b/src/providers/data_provider_opts.c
@@ -42,7 +42,6 @@ int dp_get_options(TALLOC_CTX *memctx,
opts[i].opt_name = def_opts[i].opt_name;
opts[i].type = def_opts[i].type;
opts[i].def_val = def_opts[i].def_val;
- ret = EOK;
switch (def_opts[i].type) {
case DP_OPT_STRING:
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index cfb3f42b..6892c665 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -270,7 +270,6 @@ static krb5_error_code create_ccache_file(struct krb5_req *kr, krb5_creds *creds
done:
if (fd != -1) {
close(fd);
- fd = -1;
}
if (kerr != 0 && tmp_cc != NULL) {
krb5_cc_destroy(kr->ctx, tmp_cc);
diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c
index 87b95633..d6051921 100644
--- a/src/providers/ldap/ldap_id_enum.c
+++ b/src/providers/ldap/ldap_id_enum.c
@@ -521,7 +521,6 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx,
{
struct tevent_req *req, *subreq;
struct enum_groups_state *state;
- const char *attr_name;
int ret;
req = tevent_req_create(memctx, &state, struct enum_groups_state);
@@ -531,8 +530,6 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx,
state->ctx = ctx;
state->op = op;
- attr_name = ctx->opts->group_map[SDAP_AT_GROUP_NAME].name;
-
if (ctx->max_group_timestamp && !purge) {
state->filter = talloc_asprintf(state,
diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c
index 7d7832ad..90b53711 100644
--- a/src/providers/ldap/sdap_access.c
+++ b/src/providers/ldap/sdap_access.c
@@ -99,7 +99,7 @@ struct sdap_access_req_ctx {
char *basedn;
};
-static int sdap_access_decide_offline(struct tevent_req *req);
+static void sdap_access_decide_offline(struct tevent_req *req);
static int sdap_access_retry(struct tevent_req *req);
static void sdap_access_connect_done(struct tevent_req *subreq);
static void sdap_access_get_access_done(struct tevent_req *req);
@@ -182,7 +182,7 @@ static struct tevent_req *sdap_access_send(TALLOC_CTX *mem_ctx,
/* Ok, we have one result, check if we are online or offline */
if (be_is_offline(state->be_ctx)) {
/* Ok, we're offline. Return from the cache */
- ret = sdap_access_decide_offline(req);
+ sdap_access_decide_offline(req);
goto finished;
}
@@ -241,7 +241,7 @@ finished:
return req;
}
-static int sdap_access_decide_offline(struct tevent_req *req)
+static void sdap_access_decide_offline(struct tevent_req *req)
{
struct sdap_access_req_ctx *state =
tevent_req_data(req, struct sdap_access_req_ctx);
@@ -253,8 +253,6 @@ static int sdap_access_decide_offline(struct tevent_req *req)
DEBUG(6, ("Access denied by cached credentials\n"));
state->pam_status = PAM_PERM_DENIED;
}
-
- return EOK;
}
static int sdap_access_retry(struct tevent_req *req)
@@ -287,11 +285,9 @@ static void sdap_access_connect_done(struct tevent_req *subreq)
if (ret != EOK) {
if (dp_error == DP_ERR_OFFLINE) {
- ret = sdap_access_decide_offline(req);
- if (ret == EOK) {
- tevent_req_done(req);
- return;
- }
+ sdap_access_decide_offline(req);
+ tevent_req_done(req);
+ return;
}
tevent_req_error(req, ret);
@@ -344,7 +340,7 @@ static void sdap_access_get_access_done(struct tevent_req *subreq)
}
state->pam_status = PAM_SYSTEM_ERR;
} else if (dp_error == DP_ERR_OFFLINE) {
- ret = sdap_access_decide_offline(req);
+ sdap_access_decide_offline(req);
} else {
DEBUG(1, ("sdap_get_generic_send() returned error [%d][%s]\n",
ret, strerror(ret)));
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
index 9d9f2813..ab2be353 100644
--- a/src/providers/proxy/proxy_id.c
+++ b/src/providers/proxy/proxy_id.c
@@ -1039,7 +1039,6 @@ void proxy_get_account_info(struct be_req *breq)
{
struct be_acct_req *ar;
struct proxy_id_ctx *ctx;
- struct tevent_context *ev;
struct sysdb_ctx *sysdb;
struct sss_domain_info *domain;
uid_t uid;
@@ -1049,7 +1048,6 @@ void proxy_get_account_info(struct be_req *breq)
ar = talloc_get_type(breq->req_data, struct be_acct_req);
ctx = talloc_get_type(breq->be_ctx->bet_info[BET_ID].pvt_bet_data,
struct proxy_id_ctx);
- ev = breq->be_ctx->ev;
sysdb = breq->be_ctx->sysdb;
domain = breq->be_ctx->domain;