From 5e10aa878b81ba7021c216cc2b300b750d4df5e9 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Tue, 1 Mar 2016 10:50:28 +0100 Subject: [PATCH 5/8] IPA: rename ipa_s2n_get_fqlist* to ipa_s2n_get_list* --- src/providers/ipa/ipa_s2n_exop.c | 98 ++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c index 1d233cd52c18b4b6ed753bd92d186ac02ed2cb80..8c319e509d0d938525a80e5674c8e7786cb6c112 100644 --- a/src/providers/ipa/ipa_s2n_exop.c +++ b/src/providers/ipa/ipa_s2n_exop.c @@ -884,14 +884,14 @@ done: return ret; } -struct ipa_s2n_get_fqlist_state { +struct ipa_s2n_get_list_state { struct tevent_context *ev; struct ipa_id_ctx *ipa_ctx; struct sss_domain_info *dom; struct sdap_handle *sh; struct req_input req_input; - char **fqname_list; - size_t fqname_idx; + char **list; + size_t list_idx; int exop_timeout; int entry_type; enum request_types request_type; @@ -900,12 +900,12 @@ struct ipa_s2n_get_fqlist_state { struct sysdb_attrs *override_attrs; }; -static errno_t ipa_s2n_get_fqlist_step(struct tevent_req *req); -static void ipa_s2n_get_fqlist_get_override_done(struct tevent_req *subreq); -static void ipa_s2n_get_fqlist_next(struct tevent_req *subreq); -static errno_t ipa_s2n_get_fqlist_save_step(struct tevent_req *req); +static errno_t ipa_s2n_get_list_step(struct tevent_req *req); +static void ipa_s2n_get_list_get_override_done(struct tevent_req *subreq); +static void ipa_s2n_get_list_next(struct tevent_req *subreq); +static errno_t ipa_s2n_get_list_save_step(struct tevent_req *req); -static struct tevent_req *ipa_s2n_get_fqlist_send(TALLOC_CTX *mem_ctx, +static struct tevent_req *ipa_s2n_get_list_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct ipa_id_ctx *ipa_ctx, struct sss_domain_info *dom, @@ -913,13 +913,13 @@ static struct tevent_req *ipa_s2n_get_fqlist_send(TALLOC_CTX *mem_ctx, int exop_timeout, int entry_type, enum request_types request_type, - char **fqname_list) + char **list) { int ret; - struct ipa_s2n_get_fqlist_state *state; + struct ipa_s2n_get_list_state *state; struct tevent_req *req; - req = tevent_req_create(mem_ctx, &state, struct ipa_s2n_get_fqlist_state); + req = tevent_req_create(mem_ctx, &state, struct ipa_s2n_get_list_state); if (req == NULL) { return NULL; } @@ -928,8 +928,8 @@ static struct tevent_req *ipa_s2n_get_fqlist_send(TALLOC_CTX *mem_ctx, state->ipa_ctx = ipa_ctx; state->dom = dom; state->sh = sh; - state->fqname_list = fqname_list; - state->fqname_idx = 0; + state->list = list; + state->list_idx = 0; state->req_input.type = REQ_INP_NAME; state->req_input.inp.name = NULL; state->exop_timeout = exop_timeout; @@ -938,9 +938,9 @@ static struct tevent_req *ipa_s2n_get_fqlist_send(TALLOC_CTX *mem_ctx, state->attrs = NULL; state->override_attrs = NULL; - ret = ipa_s2n_get_fqlist_step(req); + ret = ipa_s2n_get_list_step(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_fqlist_step failed.\n"); + DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_list_step failed.\n"); goto done; } @@ -953,11 +953,11 @@ done: return req; } -static errno_t ipa_s2n_get_fqlist_step(struct tevent_req *req) +static errno_t ipa_s2n_get_list_step(struct tevent_req *req) { int ret; - struct ipa_s2n_get_fqlist_state *state = tevent_req_data(req, - struct ipa_s2n_get_fqlist_state); + struct ipa_s2n_get_list_state *state = tevent_req_data(req, + struct ipa_s2n_get_list_state); struct berval *bv_req; struct tevent_req *subreq; struct sss_domain_info *parent_domain; @@ -967,11 +967,11 @@ static errno_t ipa_s2n_get_fqlist_step(struct tevent_req *req) parent_domain = get_domains_head(state->dom); ret = sss_parse_name(state, parent_domain->names, - state->fqname_list[state->fqname_idx], + state->list[state->list_idx], &domain_name, &short_name); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse name '%s' [%d]: %s\n", - state->fqname_list[state->fqname_idx], + state->list[state->list_idx], ret, sss_strerror(ret)); return ret; } @@ -1003,18 +1003,18 @@ static errno_t ipa_s2n_get_fqlist_step(struct tevent_req *req) DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_exop_send failed.\n"); return ENOMEM; } - tevent_req_set_callback(subreq, ipa_s2n_get_fqlist_next, req); + tevent_req_set_callback(subreq, ipa_s2n_get_list_next, req); return EOK; } -static void ipa_s2n_get_fqlist_next(struct tevent_req *subreq) +static void ipa_s2n_get_list_next(struct tevent_req *subreq) { int ret; struct tevent_req *req = tevent_req_callback_data(subreq, struct tevent_req); - struct ipa_s2n_get_fqlist_state *state = tevent_req_data(req, - struct ipa_s2n_get_fqlist_state); + struct ipa_s2n_get_list_state *state = tevent_req_data(req, + struct ipa_s2n_get_list_state); char *retoid = NULL; struct berval *retdata = NULL; const char *sid_str; @@ -1035,11 +1035,11 @@ static void ipa_s2n_get_fqlist_next(struct tevent_req *subreq) } if (is_default_view(state->ipa_ctx->view_name)) { - ret = ipa_s2n_get_fqlist_save_step(req); + ret = ipa_s2n_get_list_save_step(req); if (ret == EOK) { tevent_req_done(req); } else if (ret != EAGAIN) { - DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_fqlist_save_step failed.\n"); + DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_list_save_step failed.\n"); goto fail; } @@ -1071,7 +1071,7 @@ static void ipa_s2n_get_fqlist_next(struct tevent_req *subreq) ret = ENOMEM; goto fail; } - tevent_req_set_callback(subreq, ipa_s2n_get_fqlist_get_override_done, req); + tevent_req_set_callback(subreq, ipa_s2n_get_list_get_override_done, req); return; @@ -1080,13 +1080,13 @@ fail: return; } -static void ipa_s2n_get_fqlist_get_override_done(struct tevent_req *subreq) +static void ipa_s2n_get_list_get_override_done(struct tevent_req *subreq) { int ret; struct tevent_req *req = tevent_req_callback_data(subreq, struct tevent_req); - struct ipa_s2n_get_fqlist_state *state = tevent_req_data(req, - struct ipa_s2n_get_fqlist_state); + struct ipa_s2n_get_list_state *state = tevent_req_data(req, + struct ipa_s2n_get_list_state); ret = ipa_get_ad_override_recv(subreq, NULL, state, &state->override_attrs); talloc_zfree(subreq); @@ -1095,11 +1095,11 @@ static void ipa_s2n_get_fqlist_get_override_done(struct tevent_req *subreq) goto fail; } - ret = ipa_s2n_get_fqlist_save_step(req); + ret = ipa_s2n_get_list_save_step(req); if (ret == EOK) { tevent_req_done(req); } else if (ret != EAGAIN) { - DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_fqlist_save_step failed.\n"); + DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_list_save_step failed.\n"); goto fail; } @@ -1110,11 +1110,11 @@ fail: return; } -static errno_t ipa_s2n_get_fqlist_save_step(struct tevent_req *req) +static errno_t ipa_s2n_get_list_save_step(struct tevent_req *req) { int ret; - struct ipa_s2n_get_fqlist_state *state = tevent_req_data(req, - struct ipa_s2n_get_fqlist_state); + struct ipa_s2n_get_list_state *state = tevent_req_data(req, + struct ipa_s2n_get_list_state); ret = ipa_s2n_save_objects(state->dom, &state->req_input, state->attrs, NULL, state->ipa_ctx->view_name, @@ -1124,21 +1124,21 @@ static errno_t ipa_s2n_get_fqlist_save_step(struct tevent_req *req) return ret; } - state->fqname_idx++; - if (state->fqname_list[state->fqname_idx] == NULL) { + state->list_idx++; + if (state->list[state->list_idx] == NULL) { return EOK; } - ret = ipa_s2n_get_fqlist_step(req); + ret = ipa_s2n_get_list_step(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_fqlist_step failed.\n"); + DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_list_step failed.\n"); return ret; } return EAGAIN; } -static int ipa_s2n_get_fqlist_recv(struct tevent_req *req) +static int ipa_s2n_get_list_recv(struct tevent_req *req) { TEVENT_REQ_RETURN_ON_ERROR(req); @@ -1445,7 +1445,7 @@ done: return ret; } -static void ipa_s2n_get_fqlist_done(struct tevent_req *subreq); +static void ipa_s2n_get_list_done(struct tevent_req *subreq); static void ipa_s2n_get_user_get_override_done(struct tevent_req *subreq); static void ipa_s2n_get_user_done(struct tevent_req *subreq) { @@ -1504,7 +1504,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) } if (missing_list != NULL) { - subreq = ipa_s2n_get_fqlist_send(state, state->ev, + subreq = ipa_s2n_get_list_send(state, state->ev, state->ipa_ctx, state->dom, state->sh, state->exop_timeout, BE_REQ_GROUP, @@ -1512,11 +1512,11 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) missing_list); if (subreq == NULL) { DEBUG(SSSDBG_OP_FAILURE, - "ipa_s2n_get_fqlist_send failed.\n"); + "ipa_s2n_get_list_send failed.\n"); ret = ENOMEM; goto done; } - tevent_req_set_callback(subreq, ipa_s2n_get_fqlist_done, + tevent_req_set_callback(subreq, ipa_s2n_get_list_done, req); return; @@ -1531,7 +1531,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) } if (missing_list != NULL) { - subreq = ipa_s2n_get_fqlist_send(state, state->ev, + subreq = ipa_s2n_get_list_send(state, state->ev, state->ipa_ctx, state->dom, state->sh, state->exop_timeout, BE_REQ_USER, @@ -1539,11 +1539,11 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) missing_list); if (subreq == NULL) { DEBUG(SSSDBG_OP_FAILURE, - "ipa_s2n_get_fqlist_send failed.\n"); + "ipa_s2n_get_list_send failed.\n"); ret = ENOMEM; goto done; } - tevent_req_set_callback(subreq, ipa_s2n_get_fqlist_done, + tevent_req_set_callback(subreq, ipa_s2n_get_list_done, req); return; @@ -2236,7 +2236,7 @@ done: return ret; } -static void ipa_s2n_get_fqlist_done(struct tevent_req *subreq) +static void ipa_s2n_get_list_done(struct tevent_req *subreq) { int ret; struct tevent_req *req = tevent_req_callback_data(subreq, @@ -2246,7 +2246,7 @@ static void ipa_s2n_get_fqlist_done(struct tevent_req *subreq) const char *sid_str; struct be_acct_req *ar; - ret = ipa_s2n_get_fqlist_recv(subreq); + ret = ipa_s2n_get_list_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, "s2n get_fqlist request failed.\n"); -- 2.1.0