|
|
5cd47f |
From bd15a135c1b73996208557f36718410a7a6b20b2 Mon Sep 17 00:00:00 2001
|
|
|
5cd47f |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
5cd47f |
Date: Thu, 15 Aug 2019 11:56:55 +0200
|
|
|
5cd47f |
Subject: [PATCH 84/90] ldap: rename sdap_autofs_get_map to
|
|
|
5cd47f |
sdap_autofs_enumerate
|
|
|
5cd47f |
MIME-Version: 1.0
|
|
|
5cd47f |
Content-Type: text/plain; charset=UTF-8
|
|
|
5cd47f |
Content-Transfer-Encoding: 8bit
|
|
|
5cd47f |
|
|
|
5cd47f |
get_map name will be later used to obtain only the map object.
|
|
|
5cd47f |
|
|
|
5cd47f |
Resolves:
|
|
|
5cd47f |
https://pagure.io/SSSD/sssd/issue/2607
|
|
|
5cd47f |
|
|
|
5cd47f |
Reviewed-by: Tomáš Halman <thalman@redhat.com>
|
|
|
5cd47f |
---
|
|
|
5cd47f |
src/providers/ldap/sdap_autofs.c | 60 ++++++++++++++++----------------
|
|
|
5cd47f |
1 file changed, 30 insertions(+), 30 deletions(-)
|
|
|
5cd47f |
|
|
|
5cd47f |
diff --git a/src/providers/ldap/sdap_autofs.c b/src/providers/ldap/sdap_autofs.c
|
|
|
5cd47f |
index f65028d4e..5b9146199 100644
|
|
|
5cd47f |
--- a/src/providers/ldap/sdap_autofs.c
|
|
|
5cd47f |
+++ b/src/providers/ldap/sdap_autofs.c
|
|
|
5cd47f |
@@ -34,7 +34,7 @@
|
|
|
5cd47f |
#include "db/sysdb_autofs.h"
|
|
|
5cd47f |
#include "util/util.h"
|
|
|
5cd47f |
|
|
|
5cd47f |
-struct autofs_get_map_state {
|
|
|
5cd47f |
+struct sdap_autofs_enumerate_state {
|
|
|
5cd47f |
struct tevent_context *ev;
|
|
|
5cd47f |
struct sdap_id_ctx *ctx;
|
|
|
5cd47f |
struct sdap_id_op *op;
|
|
|
5cd47f |
@@ -44,23 +44,23 @@ struct autofs_get_map_state {
|
|
|
5cd47f |
};
|
|
|
5cd47f |
|
|
|
5cd47f |
static errno_t
|
|
|
5cd47f |
-sdap_autofs_get_map_retry(struct tevent_req *req);
|
|
|
5cd47f |
+sdap_autofs_enumerate_retry(struct tevent_req *req);
|
|
|
5cd47f |
static void
|
|
|
5cd47f |
-sdap_autofs_get_map_connect_done(struct tevent_req *subreq);
|
|
|
5cd47f |
+sdap_autofs_enumerate_connect_done(struct tevent_req *subreq);
|
|
|
5cd47f |
static void
|
|
|
5cd47f |
-sdap_autofs_get_map_done(struct tevent_req *req);
|
|
|
5cd47f |
+sdap_autofs_enumerate_done(struct tevent_req *req);
|
|
|
5cd47f |
|
|
|
5cd47f |
static struct tevent_req *
|
|
|
5cd47f |
-sdap_autofs_get_map_send(TALLOC_CTX *mem_ctx,
|
|
|
5cd47f |
- struct tevent_context *ev,
|
|
|
5cd47f |
- struct sdap_id_ctx *ctx,
|
|
|
5cd47f |
- const char *map_name)
|
|
|
5cd47f |
+sdap_autofs_enumerate_send(TALLOC_CTX *mem_ctx,
|
|
|
5cd47f |
+ struct tevent_context *ev,
|
|
|
5cd47f |
+ struct sdap_id_ctx *ctx,
|
|
|
5cd47f |
+ const char *map_name)
|
|
|
5cd47f |
{
|
|
|
5cd47f |
struct tevent_req *req;
|
|
|
5cd47f |
- struct autofs_get_map_state *state;
|
|
|
5cd47f |
+ struct sdap_autofs_enumerate_state *state;
|
|
|
5cd47f |
int ret;
|
|
|
5cd47f |
|
|
|
5cd47f |
- req = tevent_req_create(mem_ctx, &state, struct autofs_get_map_state);
|
|
|
5cd47f |
+ req = tevent_req_create(mem_ctx, &state, struct sdap_autofs_enumerate_state);
|
|
|
5cd47f |
if (!req) return NULL;
|
|
|
5cd47f |
|
|
|
5cd47f |
state->ev = ev;
|
|
|
5cd47f |
@@ -75,7 +75,7 @@ sdap_autofs_get_map_send(TALLOC_CTX *mem_ctx,
|
|
|
5cd47f |
goto fail;
|
|
|
5cd47f |
}
|
|
|
5cd47f |
|
|
|
5cd47f |
- ret = sdap_autofs_get_map_retry(req);
|
|
|
5cd47f |
+ ret = sdap_autofs_enumerate_retry(req);
|
|
|
5cd47f |
if (ret != EOK) {
|
|
|
5cd47f |
goto fail;
|
|
|
5cd47f |
}
|
|
|
5cd47f |
@@ -89,10 +89,10 @@ fail:
|
|
|
5cd47f |
}
|
|
|
5cd47f |
|
|
|
5cd47f |
static errno_t
|
|
|
5cd47f |
-sdap_autofs_get_map_retry(struct tevent_req *req)
|
|
|
5cd47f |
+sdap_autofs_enumerate_retry(struct tevent_req *req)
|
|
|
5cd47f |
{
|
|
|
5cd47f |
- struct autofs_get_map_state *state =
|
|
|
5cd47f |
- tevent_req_data(req, struct autofs_get_map_state);
|
|
|
5cd47f |
+ struct sdap_autofs_enumerate_state *state =
|
|
|
5cd47f |
+ tevent_req_data(req, struct sdap_autofs_enumerate_state);
|
|
|
5cd47f |
struct tevent_req *subreq;
|
|
|
5cd47f |
int ret = EOK;
|
|
|
5cd47f |
|
|
|
5cd47f |
@@ -101,17 +101,17 @@ sdap_autofs_get_map_retry(struct tevent_req *req)
|
|
|
5cd47f |
return ret;
|
|
|
5cd47f |
}
|
|
|
5cd47f |
|
|
|
5cd47f |
- tevent_req_set_callback(subreq, sdap_autofs_get_map_connect_done, req);
|
|
|
5cd47f |
+ tevent_req_set_callback(subreq, sdap_autofs_enumerate_connect_done, req);
|
|
|
5cd47f |
return EOK;
|
|
|
5cd47f |
}
|
|
|
5cd47f |
|
|
|
5cd47f |
static void
|
|
|
5cd47f |
-sdap_autofs_get_map_connect_done(struct tevent_req *subreq)
|
|
|
5cd47f |
+sdap_autofs_enumerate_connect_done(struct tevent_req *subreq)
|
|
|
5cd47f |
{
|
|
|
5cd47f |
struct tevent_req *req = tevent_req_callback_data(subreq,
|
|
|
5cd47f |
struct tevent_req);
|
|
|
5cd47f |
- struct autofs_get_map_state *state =
|
|
|
5cd47f |
- tevent_req_data(req, struct autofs_get_map_state);
|
|
|
5cd47f |
+ struct sdap_autofs_enumerate_state *state =
|
|
|
5cd47f |
+ tevent_req_data(req, struct sdap_autofs_enumerate_state);
|
|
|
5cd47f |
int dp_error = DP_ERR_FATAL;
|
|
|
5cd47f |
int ret;
|
|
|
5cd47f |
|
|
|
5cd47f |
@@ -137,17 +137,17 @@ sdap_autofs_get_map_connect_done(struct tevent_req *subreq)
|
|
|
5cd47f |
tevent_req_error(req, ENOMEM);
|
|
|
5cd47f |
return;
|
|
|
5cd47f |
}
|
|
|
5cd47f |
- tevent_req_set_callback(subreq, sdap_autofs_get_map_done, req);
|
|
|
5cd47f |
+ tevent_req_set_callback(subreq, sdap_autofs_enumerate_done, req);
|
|
|
5cd47f |
|
|
|
5cd47f |
}
|
|
|
5cd47f |
|
|
|
5cd47f |
static void
|
|
|
5cd47f |
-sdap_autofs_get_map_done(struct tevent_req *subreq)
|
|
|
5cd47f |
+sdap_autofs_enumerate_done(struct tevent_req *subreq)
|
|
|
5cd47f |
{
|
|
|
5cd47f |
struct tevent_req *req = tevent_req_callback_data(subreq,
|
|
|
5cd47f |
struct tevent_req);
|
|
|
5cd47f |
- struct autofs_get_map_state *state =
|
|
|
5cd47f |
- tevent_req_data(req, struct autofs_get_map_state);
|
|
|
5cd47f |
+ struct sdap_autofs_enumerate_state *state =
|
|
|
5cd47f |
+ tevent_req_data(req, struct sdap_autofs_enumerate_state);
|
|
|
5cd47f |
int dp_error = DP_ERR_FATAL;
|
|
|
5cd47f |
int ret;
|
|
|
5cd47f |
|
|
|
5cd47f |
@@ -157,7 +157,7 @@ sdap_autofs_get_map_done(struct tevent_req *subreq)
|
|
|
5cd47f |
ret = sdap_id_op_done(state->op, ret, &dp_error);
|
|
|
5cd47f |
if (dp_error == DP_ERR_OK && ret != EOK) {
|
|
|
5cd47f |
/* retry */
|
|
|
5cd47f |
- ret = sdap_autofs_get_map_retry(req);
|
|
|
5cd47f |
+ ret = sdap_autofs_enumerate_retry(req);
|
|
|
5cd47f |
if (ret != EOK) {
|
|
|
5cd47f |
tevent_req_error(req, ret);
|
|
|
5cd47f |
return;
|
|
|
5cd47f |
@@ -187,10 +187,10 @@ sdap_autofs_get_map_done(struct tevent_req *subreq)
|
|
|
5cd47f |
}
|
|
|
5cd47f |
|
|
|
5cd47f |
static errno_t
|
|
|
5cd47f |
-sdap_autofs_get_map_recv(struct tevent_req *req, int *dp_error_out)
|
|
|
5cd47f |
+sdap_autofs_enumerate_recv(struct tevent_req *req, int *dp_error_out)
|
|
|
5cd47f |
{
|
|
|
5cd47f |
- struct autofs_get_map_state *state =
|
|
|
5cd47f |
- tevent_req_data(req, struct autofs_get_map_state);
|
|
|
5cd47f |
+ struct sdap_autofs_enumerate_state *state =
|
|
|
5cd47f |
+ tevent_req_data(req, struct sdap_autofs_enumerate_state);
|
|
|
5cd47f |
|
|
|
5cd47f |
if (dp_error_out) {
|
|
|
5cd47f |
*dp_error_out = state->dp_error;
|
|
|
5cd47f |
@@ -217,7 +217,6 @@ sdap_autofs_enumerate_handler_send(TALLOC_CTX *mem_ctx,
|
|
|
5cd47f |
struct tevent_req *subreq;
|
|
|
5cd47f |
struct tevent_req *req;
|
|
|
5cd47f |
const char *master_map;
|
|
|
5cd47f |
-
|
|
|
5cd47f |
errno_t ret;
|
|
|
5cd47f |
|
|
|
5cd47f |
req = tevent_req_create(mem_ctx, &state, struct sdap_autofs_enumerate_handler_state);
|
|
|
5cd47f |
@@ -241,8 +240,8 @@ sdap_autofs_enumerate_handler_send(TALLOC_CTX *mem_ctx,
|
|
|
5cd47f |
}
|
|
|
5cd47f |
}
|
|
|
5cd47f |
|
|
|
5cd47f |
- subreq = sdap_autofs_get_map_send(mem_ctx, params->ev,
|
|
|
5cd47f |
- id_ctx, data->mapname);
|
|
|
5cd47f |
+ subreq = sdap_autofs_enumerate_send(mem_ctx, params->ev,
|
|
|
5cd47f |
+ id_ctx, data->mapname);
|
|
|
5cd47f |
if (subreq == NULL) {
|
|
|
5cd47f |
DEBUG(SSSDBG_CRIT_FAILURE, "Unable to send request for %s.\n",
|
|
|
5cd47f |
data->mapname);
|
|
|
5cd47f |
@@ -262,6 +261,7 @@ immediately:
|
|
|
5cd47f |
tevent_req_post(req, params->ev);
|
|
|
5cd47f |
|
|
|
5cd47f |
return req;
|
|
|
5cd47f |
+
|
|
|
5cd47f |
}
|
|
|
5cd47f |
|
|
|
5cd47f |
static void sdap_autofs_enumerate_handler_done(struct tevent_req *subreq)
|
|
|
5cd47f |
@@ -274,7 +274,7 @@ static void sdap_autofs_enumerate_handler_done(struct tevent_req *subreq)
|
|
|
5cd47f |
req = tevent_req_callback_data(subreq, struct tevent_req);
|
|
|
5cd47f |
state = tevent_req_data(req, struct sdap_autofs_enumerate_handler_state);
|
|
|
5cd47f |
|
|
|
5cd47f |
- ret = sdap_autofs_get_map_recv(subreq, &dp_error);
|
|
|
5cd47f |
+ ret = sdap_autofs_enumerate_recv(subreq, &dp_error);
|
|
|
5cd47f |
talloc_zfree(subreq);
|
|
|
5cd47f |
|
|
|
5cd47f |
/* TODO For backward compatibility we always return EOK to DP now. */
|
|
|
5cd47f |
--
|
|
|
5cd47f |
2.20.1
|
|
|
5cd47f |
|