Blame SOURCES/0165-IPA-rename-ipa_s2n_get_groups_send-to-ipa_s2n_get_fq.patch

905b4d
From a1f99b4609c29bf92ad717f7f21a62582fe24e1f Mon Sep 17 00:00:00 2001
905b4d
From: Sumit Bose <sbose@redhat.com>
905b4d
Date: Tue, 9 Dec 2014 17:04:30 +0100
905b4d
Subject: [PATCH 165/167] IPA: rename ipa_s2n_get_groups_send() to
905b4d
 ipa_s2n_get_fqlist_send()
905b4d
905b4d
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
905b4d
(cherry picked from commit f1f22df95996390f63266ebacb624e521d934592)
905b4d
---
905b4d
 src/providers/ipa/ipa_s2n_exop.c | 100 +++++++++++++++++++--------------------
905b4d
 1 file changed, 50 insertions(+), 50 deletions(-)
905b4d
905b4d
diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c
905b4d
index bc476b469d02ea5f80d7e792693f5d25db889b74..505c2325f2a74e26816bb59ad3c7d4810cc64dbf 100644
905b4d
--- a/src/providers/ipa/ipa_s2n_exop.c
905b4d
+++ b/src/providers/ipa/ipa_s2n_exop.c
905b4d
@@ -877,38 +877,38 @@ done:
905b4d
     return ret;
905b4d
 }
905b4d
 
905b4d
-struct ipa_s2n_get_groups_state {
905b4d
+struct ipa_s2n_get_fqlist_state {
905b4d
     struct tevent_context *ev;
905b4d
     struct ipa_id_ctx *ipa_ctx;
905b4d
     struct sss_domain_info *dom;
905b4d
     struct sdap_handle *sh;
905b4d
     struct req_input req_input;
905b4d
-    char **group_list;
905b4d
-    size_t group_idx;
905b4d
+    char **fqname_list;
905b4d
+    size_t fqname_idx;
905b4d
     int exop_timeout;
905b4d
     struct resp_attrs *attrs;
905b4d
     struct sss_domain_info *obj_domain;
905b4d
     struct sysdb_attrs *override_attrs;
905b4d
 };
905b4d
 
905b4d
-static errno_t ipa_s2n_get_groups_step(struct tevent_req *req);
905b4d
-static void ipa_s2n_get_groups_get_override_done(struct tevent_req *subreq);
905b4d
-static void ipa_s2n_get_groups_next(struct tevent_req *subreq);
905b4d
-static errno_t ipa_s2n_get_groups_save_step(struct tevent_req *req);
905b4d
+static errno_t ipa_s2n_get_fqlist_step(struct tevent_req *req);
905b4d
+static void ipa_s2n_get_fqlist_get_override_done(struct tevent_req *subreq);
905b4d
+static void ipa_s2n_get_fqlist_next(struct tevent_req *subreq);
905b4d
+static errno_t ipa_s2n_get_fqlist_save_step(struct tevent_req *req);
905b4d
 
905b4d
-static struct tevent_req *ipa_s2n_get_groups_send(TALLOC_CTX *mem_ctx,
905b4d
+static struct tevent_req *ipa_s2n_get_fqlist_send(TALLOC_CTX *mem_ctx,
905b4d
                                                   struct tevent_context *ev,
905b4d
                                                   struct ipa_id_ctx *ipa_ctx,
905b4d
                                                   struct sss_domain_info *dom,
905b4d
                                                   struct sdap_handle *sh,
905b4d
                                                   int exop_timeout,
905b4d
-                                                  char **group_list)
905b4d
+                                                  char **fqname_list)
905b4d
 {
905b4d
     int ret;
905b4d
-    struct ipa_s2n_get_groups_state *state;
905b4d
+    struct ipa_s2n_get_fqlist_state *state;
905b4d
     struct tevent_req *req;
905b4d
 
905b4d
-    req = tevent_req_create(mem_ctx, &state, struct ipa_s2n_get_groups_state);
905b4d
+    req = tevent_req_create(mem_ctx, &state, struct ipa_s2n_get_fqlist_state);
905b4d
     if (req == NULL) {
905b4d
         return NULL;
905b4d
     }
905b4d
@@ -917,17 +917,17 @@ static struct tevent_req *ipa_s2n_get_groups_send(TALLOC_CTX *mem_ctx,
905b4d
     state->ipa_ctx = ipa_ctx;
905b4d
     state->dom = dom;
905b4d
     state->sh = sh;
905b4d
-    state->group_list = group_list;
905b4d
-    state->group_idx = 0;
905b4d
+    state->fqname_list = fqname_list;
905b4d
+    state->fqname_idx = 0;
905b4d
     state->req_input.type = REQ_INP_NAME;
905b4d
     state->req_input.inp.name = NULL;
905b4d
     state->exop_timeout = exop_timeout;
905b4d
     state->attrs = NULL;
905b4d
     state->override_attrs = NULL;
905b4d
 
905b4d
-    ret = ipa_s2n_get_groups_step(req);
905b4d
+    ret = ipa_s2n_get_fqlist_step(req);
905b4d
     if (ret != EOK) {
905b4d
-        DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_groups_step failed.\n");
905b4d
+        DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_fqlist_step failed.\n");
905b4d
         goto done;
905b4d
     }
905b4d
 
905b4d
@@ -940,25 +940,25 @@ done:
905b4d
     return req;
905b4d
 }
905b4d
 
905b4d
-static errno_t ipa_s2n_get_groups_step(struct tevent_req *req)
905b4d
+static errno_t ipa_s2n_get_fqlist_step(struct tevent_req *req)
905b4d
 {
905b4d
     int ret;
905b4d
-    struct ipa_s2n_get_groups_state *state = tevent_req_data(req,
905b4d
-                                               struct ipa_s2n_get_groups_state);
905b4d
+    struct ipa_s2n_get_fqlist_state *state = tevent_req_data(req,
905b4d
+                                               struct ipa_s2n_get_fqlist_state);
905b4d
     struct berval *bv_req;
905b4d
     struct tevent_req *subreq;
905b4d
     struct sss_domain_info *parent_domain;
905b4d
-    char *group_name = NULL;
905b4d
+    char *short_name = NULL;
905b4d
     char *domain_name = NULL;
905b4d
 
905b4d
     parent_domain = get_domains_head(state->dom);
905b4d
 
905b4d
     ret = sss_parse_name(state, parent_domain->names,
905b4d
-                         state->group_list[state->group_idx],
905b4d
-                         &domain_name, &group_name);
905b4d
+                         state->fqname_list[state->fqname_idx],
905b4d
+                         &domain_name, &short_name);
905b4d
     if (ret != EOK) {
905b4d
         DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse name '%s' [%d]: %s\n",
905b4d
-                                    state->group_list[state->group_idx],
905b4d
+                                    state->fqname_list[state->fqname_idx],
905b4d
                                     ret, sss_strerror(ret));
905b4d
         return ret;
905b4d
     }
905b4d
@@ -974,7 +974,7 @@ static errno_t ipa_s2n_get_groups_step(struct tevent_req *req)
905b4d
         state->obj_domain = parent_domain;
905b4d
     }
905b4d
 
905b4d
-    state->req_input.inp.name = group_name;
905b4d
+    state->req_input.inp.name = short_name;
905b4d
 
905b4d
     ret = s2n_encode_request(state, state->obj_domain->name, BE_REQ_GROUP,
905b4d
                              REQ_FULL_WITH_MEMBERS,
905b4d
@@ -990,18 +990,18 @@ static errno_t ipa_s2n_get_groups_step(struct tevent_req *req)
905b4d
         DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_exop_send failed.\n");
905b4d
         return ENOMEM;
905b4d
     }
905b4d
-    tevent_req_set_callback(subreq, ipa_s2n_get_groups_next, req);
905b4d
+    tevent_req_set_callback(subreq, ipa_s2n_get_fqlist_next, req);
905b4d
 
905b4d
     return EOK;
905b4d
 }
905b4d
 
905b4d
-static void ipa_s2n_get_groups_next(struct tevent_req *subreq)
905b4d
+static void ipa_s2n_get_fqlist_next(struct tevent_req *subreq)
905b4d
 {
905b4d
     int ret;
905b4d
     struct tevent_req *req = tevent_req_callback_data(subreq,
905b4d
                                                       struct tevent_req);
905b4d
-    struct ipa_s2n_get_groups_state *state = tevent_req_data(req,
905b4d
-                                               struct ipa_s2n_get_groups_state);
905b4d
+    struct ipa_s2n_get_fqlist_state *state = tevent_req_data(req,
905b4d
+                                               struct ipa_s2n_get_fqlist_state);
905b4d
     char *retoid = NULL;
905b4d
     struct berval *retdata = NULL;
905b4d
     const char *sid_str;
905b4d
@@ -1022,11 +1022,11 @@ static void ipa_s2n_get_groups_next(struct tevent_req *subreq)
905b4d
     }
905b4d
 
905b4d
     if (strcmp(state->ipa_ctx->view_name, SYSDB_DEFAULT_VIEW_NAME) == 0) {
905b4d
-        ret = ipa_s2n_get_groups_save_step(req);
905b4d
+        ret = ipa_s2n_get_fqlist_save_step(req);
905b4d
         if (ret == EOK) {
905b4d
             tevent_req_done(req);
905b4d
         } else if (ret != EAGAIN) {
905b4d
-            DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_groups_save_step failed.\n");
905b4d
+            DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_fqlist_save_step failed.\n");
905b4d
             goto fail;
905b4d
         }
905b4d
 
905b4d
@@ -1058,7 +1058,7 @@ static void ipa_s2n_get_groups_next(struct tevent_req *subreq)
905b4d
         ret = ENOMEM;
905b4d
         goto fail;
905b4d
     }
905b4d
-    tevent_req_set_callback(subreq, ipa_s2n_get_groups_get_override_done, req);
905b4d
+    tevent_req_set_callback(subreq, ipa_s2n_get_fqlist_get_override_done, req);
905b4d
 
905b4d
     return;
905b4d
 
905b4d
@@ -1067,13 +1067,13 @@ fail:
905b4d
     return;
905b4d
 }
905b4d
 
905b4d
-static void ipa_s2n_get_groups_get_override_done(struct tevent_req *subreq)
905b4d
+static void ipa_s2n_get_fqlist_get_override_done(struct tevent_req *subreq)
905b4d
 {
905b4d
     int ret;
905b4d
     struct tevent_req *req = tevent_req_callback_data(subreq,
905b4d
                                                       struct tevent_req);
905b4d
-    struct ipa_s2n_get_groups_state *state = tevent_req_data(req,
905b4d
-                                               struct ipa_s2n_get_groups_state);
905b4d
+    struct ipa_s2n_get_fqlist_state *state = tevent_req_data(req,
905b4d
+                                               struct ipa_s2n_get_fqlist_state);
905b4d
 
905b4d
     ret = ipa_get_ad_override_recv(subreq, NULL, state, &state->override_attrs);
905b4d
     talloc_zfree(subreq);
905b4d
@@ -1082,11 +1082,11 @@ static void ipa_s2n_get_groups_get_override_done(struct tevent_req *subreq)
905b4d
         goto fail;
905b4d
     }
905b4d
 
905b4d
-    ret = ipa_s2n_get_groups_save_step(req);
905b4d
+    ret = ipa_s2n_get_fqlist_save_step(req);
905b4d
     if (ret == EOK) {
905b4d
         tevent_req_done(req);
905b4d
     } else if (ret != EAGAIN) {
905b4d
-        DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_groups_save_step failed.\n");
905b4d
+        DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_fqlist_save_step failed.\n");
905b4d
         goto fail;
905b4d
     }
905b4d
 
905b4d
@@ -1097,11 +1097,11 @@ fail:
905b4d
     return;
905b4d
 }
905b4d
 
905b4d
-static errno_t ipa_s2n_get_groups_save_step(struct tevent_req *req)
905b4d
+static errno_t ipa_s2n_get_fqlist_save_step(struct tevent_req *req)
905b4d
 {
905b4d
     int ret;
905b4d
-    struct ipa_s2n_get_groups_state *state = tevent_req_data(req,
905b4d
-                                               struct ipa_s2n_get_groups_state);
905b4d
+    struct ipa_s2n_get_fqlist_state *state = tevent_req_data(req,
905b4d
+                                               struct ipa_s2n_get_fqlist_state);
905b4d
 
905b4d
     ret = ipa_s2n_save_objects(state->dom, &state->req_input, state->attrs,
905b4d
                                NULL, state->ipa_ctx->view_name,
905b4d
@@ -1111,21 +1111,21 @@ static errno_t ipa_s2n_get_groups_save_step(struct tevent_req *req)
905b4d
         return ret;
905b4d
     }
905b4d
 
905b4d
-    state->group_idx++;
905b4d
-    if (state->group_list[state->group_idx] == NULL) {
905b4d
+    state->fqname_idx++;
905b4d
+    if (state->fqname_list[state->fqname_idx] == NULL) {
905b4d
         return EOK;
905b4d
     }
905b4d
 
905b4d
-    ret = ipa_s2n_get_groups_step(req);
905b4d
+    ret = ipa_s2n_get_fqlist_step(req);
905b4d
     if (ret != EOK) {
905b4d
-        DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_groups_step failed.\n");
905b4d
+        DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_get_fqlist_step failed.\n");
905b4d
         return ret;
905b4d
     }
905b4d
 
905b4d
     return EAGAIN;
905b4d
 }
905b4d
 
905b4d
-static int ipa_s2n_get_groups_recv(struct tevent_req *req)
905b4d
+static int ipa_s2n_get_fqlist_recv(struct tevent_req *req)
905b4d
 {
905b4d
     TEVENT_REQ_RETURN_ON_ERROR(req);
905b4d
 
905b4d
@@ -1426,7 +1426,7 @@ done:
905b4d
     return ret;
905b4d
 }
905b4d
 
905b4d
-static void ipa_s2n_get_groups_done(struct tevent_req  *subreq);
905b4d
+static void ipa_s2n_get_fqlist_done(struct tevent_req  *subreq);
905b4d
 static void ipa_s2n_get_user_get_override_done(struct tevent_req *subreq);
905b4d
 static void ipa_s2n_get_user_done(struct tevent_req *subreq)
905b4d
 {
905b4d
@@ -1485,17 +1485,17 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq)
905b4d
             }
905b4d
 
905b4d
             if (missing_groups != NULL) {
905b4d
-                subreq = ipa_s2n_get_groups_send(state, state->ev,
905b4d
+                subreq = ipa_s2n_get_fqlist_send(state, state->ev,
905b4d
                                                  state->ipa_ctx, state->dom,
905b4d
                                                  state->sh, state->exop_timeout,
905b4d
                                                  missing_groups);
905b4d
                 if (subreq == NULL) {
905b4d
                     DEBUG(SSSDBG_OP_FAILURE,
905b4d
-                          "ipa_s2n_get_groups_send failed.\n");
905b4d
+                          "ipa_s2n_get_fqlist_send failed.\n");
905b4d
                     ret = ENOMEM;
905b4d
                     goto done;
905b4d
                 }
905b4d
-                tevent_req_set_callback(subreq, ipa_s2n_get_groups_done,
905b4d
+                tevent_req_set_callback(subreq, ipa_s2n_get_fqlist_done,
905b4d
                                         req);
905b4d
 
905b4d
                 return;
905b4d
@@ -2089,7 +2089,7 @@ done:
905b4d
     return ret;
905b4d
 }
905b4d
 
905b4d
-static void ipa_s2n_get_groups_done(struct tevent_req  *subreq)
905b4d
+static void ipa_s2n_get_fqlist_done(struct tevent_req  *subreq)
905b4d
 {
905b4d
     int ret;
905b4d
     struct tevent_req *req = tevent_req_callback_data(subreq,
905b4d
@@ -2099,10 +2099,10 @@ static void ipa_s2n_get_groups_done(struct tevent_req  *subreq)
905b4d
     const char *sid_str;
905b4d
     struct be_acct_req *ar;
905b4d
 
905b4d
-    ret = ipa_s2n_get_groups_recv(subreq);
905b4d
+    ret = ipa_s2n_get_fqlist_recv(subreq);
905b4d
     talloc_zfree(subreq);
905b4d
     if (ret != EOK) {
905b4d
-        DEBUG(SSSDBG_OP_FAILURE, "s2n get_groups request failed.\n");
905b4d
+        DEBUG(SSSDBG_OP_FAILURE, "s2n get_fqlist request failed.\n");
905b4d
         tevent_req_error(req, ret);
905b4d
         return;
905b4d
     }
905b4d
-- 
905b4d
2.1.0
905b4d