|
|
8d3578 |
From 4665606235605b1d5d1ec7462257aaa86aa3d7b1 Mon Sep 17 00:00:00 2001
|
|
|
8d3578 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
8d3578 |
Date: Wed, 28 Aug 2019 11:47:07 +0200
|
|
|
8d3578 |
Subject: [PATCH 74/90] autofs: move data provider functions to responder
|
|
|
8d3578 |
common code
|
|
|
8d3578 |
MIME-Version: 1.0
|
|
|
8d3578 |
Content-Type: text/plain; charset=UTF-8
|
|
|
8d3578 |
Content-Transfer-Encoding: 8bit
|
|
|
8d3578 |
|
|
|
8d3578 |
So it can be later used from cache_req.
|
|
|
8d3578 |
|
|
|
8d3578 |
Resolves:
|
|
|
8d3578 |
https://pagure.io/SSSD/sssd/issue/2607
|
|
|
8d3578 |
|
|
|
8d3578 |
Reviewed-by: Tomáš Halman <thalman@redhat.com>
|
|
|
8d3578 |
---
|
|
|
8d3578 |
Makefile.am | 2 +-
|
|
|
8d3578 |
src/responder/common/responder.h | 19 +++++++++++
|
|
|
8d3578 |
.../responder_dp_autofs.c} | 0
|
|
|
8d3578 |
src/tests/cmocka/common_mock_resp_dp.c | 34 +++++++++++++++++++
|
|
|
8d3578 |
4 files changed, 54 insertions(+), 1 deletion(-)
|
|
|
8d3578 |
rename src/responder/{autofs/autofssrv_dp.c => common/responder_dp_autofs.c} (100%)
|
|
|
8d3578 |
|
|
|
8d3578 |
diff --git a/Makefile.am b/Makefile.am
|
|
|
8d3578 |
index e74de422d..c109afe56 100644
|
|
|
8d3578 |
--- a/Makefile.am
|
|
|
8d3578 |
+++ b/Makefile.am
|
|
|
8d3578 |
@@ -576,6 +576,7 @@ SSSD_RESPONDER_OBJ = \
|
|
|
8d3578 |
src/responder/common/responder_common.c \
|
|
|
8d3578 |
src/responder/common/responder_dp.c \
|
|
|
8d3578 |
src/responder/common/responder_dp_ssh.c \
|
|
|
8d3578 |
+ src/responder/common/responder_dp_autofs.c \
|
|
|
8d3578 |
src/responder/common/responder_packet.c \
|
|
|
8d3578 |
src/responder/common/responder_get_domains.c \
|
|
|
8d3578 |
src/responder/common/responder_utils.c \
|
|
|
8d3578 |
@@ -1434,7 +1435,6 @@ if BUILD_AUTOFS
|
|
|
8d3578 |
sssd_autofs_SOURCES = \
|
|
|
8d3578 |
src/responder/autofs/autofssrv.c \
|
|
|
8d3578 |
src/responder/autofs/autofssrv_cmd.c \
|
|
|
8d3578 |
- src/responder/autofs/autofssrv_dp.c \
|
|
|
8d3578 |
$(SSSD_RESPONDER_OBJ)
|
|
|
8d3578 |
sssd_autofs_LDADD = \
|
|
|
8d3578 |
$(LIBADD_DL) \
|
|
|
8d3578 |
diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h
|
|
|
8d3578 |
index 987a5d17d..17b04c3de 100644
|
|
|
8d3578 |
--- a/src/responder/common/responder.h
|
|
|
8d3578 |
+++ b/src/responder/common/responder.h
|
|
|
8d3578 |
@@ -363,6 +363,25 @@ sss_dp_get_ssh_host_recv(TALLOC_CTX *mem_ctx,
|
|
|
8d3578 |
dbus_uint32_t *dp_ret,
|
|
|
8d3578 |
char **err_msg);
|
|
|
8d3578 |
|
|
|
8d3578 |
+enum sss_dp_autofs_type {
|
|
|
8d3578 |
+ SSS_DP_AUTOFS
|
|
|
8d3578 |
+};
|
|
|
8d3578 |
+
|
|
|
8d3578 |
+struct tevent_req *
|
|
|
8d3578 |
+sss_dp_get_autofs_send(TALLOC_CTX *mem_ctx,
|
|
|
8d3578 |
+ struct resp_ctx *rctx,
|
|
|
8d3578 |
+ struct sss_domain_info *dom,
|
|
|
8d3578 |
+ bool fast_reply,
|
|
|
8d3578 |
+ enum sss_dp_autofs_type type,
|
|
|
8d3578 |
+ const char *name);
|
|
|
8d3578 |
+
|
|
|
8d3578 |
+errno_t
|
|
|
8d3578 |
+sss_dp_get_autofs_recv(TALLOC_CTX *mem_ctx,
|
|
|
8d3578 |
+ struct tevent_req *req,
|
|
|
8d3578 |
+ dbus_uint16_t *dp_err,
|
|
|
8d3578 |
+ dbus_uint32_t *dp_ret,
|
|
|
8d3578 |
+ char **err_msg);
|
|
|
8d3578 |
+
|
|
|
8d3578 |
bool sss_utf8_check(const uint8_t *s, size_t n);
|
|
|
8d3578 |
|
|
|
8d3578 |
void responder_set_fd_limit(rlim_t fd_limit);
|
|
|
8d3578 |
diff --git a/src/responder/autofs/autofssrv_dp.c b/src/responder/common/responder_dp_autofs.c
|
|
|
8d3578 |
similarity index 100%
|
|
|
8d3578 |
rename from src/responder/autofs/autofssrv_dp.c
|
|
|
8d3578 |
rename to src/responder/common/responder_dp_autofs.c
|
|
|
8d3578 |
diff --git a/src/tests/cmocka/common_mock_resp_dp.c b/src/tests/cmocka/common_mock_resp_dp.c
|
|
|
8d3578 |
index a85257515..93e507100 100644
|
|
|
8d3578 |
--- a/src/tests/cmocka/common_mock_resp_dp.c
|
|
|
8d3578 |
+++ b/src/tests/cmocka/common_mock_resp_dp.c
|
|
|
8d3578 |
@@ -95,6 +95,40 @@ sss_dp_get_ssh_host_recv(TALLOC_CTX *mem_ctx,
|
|
|
8d3578 |
return test_request_recv(req);
|
|
|
8d3578 |
}
|
|
|
8d3578 |
|
|
|
8d3578 |
+struct tevent_req *
|
|
|
8d3578 |
+sss_dp_get_autofs_send(TALLOC_CTX *mem_ctx,
|
|
|
8d3578 |
+ struct resp_ctx *rctx,
|
|
|
8d3578 |
+ struct sss_domain_info *dom,
|
|
|
8d3578 |
+ bool fast_reply,
|
|
|
8d3578 |
+ enum sss_dp_autofs_type type,
|
|
|
8d3578 |
+ const char *mapname,
|
|
|
8d3578 |
+ const char *entryname)
|
|
|
8d3578 |
+{
|
|
|
8d3578 |
+ return test_req_succeed_send(mem_ctx, rctx->ev);
|
|
|
8d3578 |
+}
|
|
|
8d3578 |
+
|
|
|
8d3578 |
+
|
|
|
8d3578 |
+errno_t
|
|
|
8d3578 |
+sss_dp_get_autofs_recv(TALLOC_CTX *mem_ctx,
|
|
|
8d3578 |
+ struct tevent_req *req,
|
|
|
8d3578 |
+ dbus_uint16_t *dp_err,
|
|
|
8d3578 |
+ dbus_uint32_t *dp_ret,
|
|
|
8d3578 |
+ char **err_msg)
|
|
|
8d3578 |
+{
|
|
|
8d3578 |
+ acct_cb_t cb;
|
|
|
8d3578 |
+
|
|
|
8d3578 |
+ *dp_err = sss_mock_type(dbus_uint16_t);
|
|
|
8d3578 |
+ *dp_ret = sss_mock_type(dbus_uint32_t);
|
|
|
8d3578 |
+ *err_msg = sss_mock_ptr_type(char *);
|
|
|
8d3578 |
+
|
|
|
8d3578 |
+ cb = sss_mock_ptr_type(acct_cb_t);
|
|
|
8d3578 |
+ if (cb) {
|
|
|
8d3578 |
+ (cb)(sss_mock_ptr_type(void *));
|
|
|
8d3578 |
+ }
|
|
|
8d3578 |
+
|
|
|
8d3578 |
+ return test_request_recv(req);
|
|
|
8d3578 |
+}
|
|
|
8d3578 |
+
|
|
|
8d3578 |
errno_t
|
|
|
8d3578 |
sss_dp_req_recv(TALLOC_CTX *mem_ctx,
|
|
|
8d3578 |
struct tevent_req *req,
|
|
|
8d3578 |
--
|
|
|
8d3578 |
2.20.1
|
|
|
8d3578 |
|