|
|
bac598 |
From a3e2677f919c6b1b1649ad80cc3435b4bb2efc0d Mon Sep 17 00:00:00 2001
|
|
|
bac598 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
bac598 |
Date: Thu, 10 Dec 2020 19:28:58 +0100
|
|
|
bac598 |
Subject: [PATCH 23/27] cache_req: add helper to call user by upn search
|
|
|
bac598 |
|
|
|
bac598 |
Reviewed-by: Robbie Harwood <rharwood@redhat.com>
|
|
|
bac598 |
Reviewed-by: Sumit Bose <sbose@redhat.com>
|
|
|
bac598 |
---
|
|
|
bac598 |
src/responder/common/cache_req/cache_req.h | 13 +++++++++++
|
|
|
bac598 |
.../cache_req/plugins/cache_req_user_by_upn.c | 23 +++++++++++++++++++
|
|
|
bac598 |
2 files changed, 36 insertions(+)
|
|
|
bac598 |
|
|
|
bac598 |
diff --git a/src/responder/common/cache_req/cache_req.h b/src/responder/common/cache_req/cache_req.h
|
|
|
bac598 |
index d36cb2d3b..d301a076e 100644
|
|
|
bac598 |
--- a/src/responder/common/cache_req/cache_req.h
|
|
|
bac598 |
+++ b/src/responder/common/cache_req/cache_req.h
|
|
|
bac598 |
@@ -277,6 +277,19 @@ cache_req_user_by_name_attrs_send(TALLOC_CTX *mem_ctx,
|
|
|
bac598 |
#define cache_req_user_by_name_attrs_recv(mem_ctx, req, _result) \
|
|
|
bac598 |
cache_req_single_domain_recv(mem_ctx, req, _result)
|
|
|
bac598 |
|
|
|
bac598 |
+struct tevent_req *
|
|
|
bac598 |
+cache_req_user_by_upn_send(TALLOC_CTX *mem_ctx,
|
|
|
bac598 |
+ struct tevent_context *ev,
|
|
|
bac598 |
+ struct resp_ctx *rctx,
|
|
|
bac598 |
+ struct sss_nc_ctx *ncache,
|
|
|
bac598 |
+ int cache_refresh_percent,
|
|
|
bac598 |
+ enum cache_req_dom_type req_dom_type,
|
|
|
bac598 |
+ const char *domain,
|
|
|
bac598 |
+ const char *upn);
|
|
|
bac598 |
+
|
|
|
bac598 |
+#define cache_req_user_by_upn_recv(mem_ctx, req, _result) \
|
|
|
bac598 |
+ cache_req_single_domain_recv(mem_ctx, req, _result);
|
|
|
bac598 |
+
|
|
|
bac598 |
struct tevent_req *
|
|
|
bac598 |
cache_req_user_by_id_send(TALLOC_CTX *mem_ctx,
|
|
|
bac598 |
struct tevent_context *ev,
|
|
|
bac598 |
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_upn.c b/src/responder/common/cache_req/plugins/cache_req_user_by_upn.c
|
|
|
bac598 |
index e08ab70ae..037994c8c 100644
|
|
|
bac598 |
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_upn.c
|
|
|
bac598 |
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_upn.c
|
|
|
bac598 |
@@ -133,3 +133,26 @@ const struct cache_req_plugin cache_req_user_by_upn = {
|
|
|
bac598 |
.dp_get_domain_send_fn = NULL,
|
|
|
bac598 |
.dp_get_domain_recv_fn = NULL,
|
|
|
bac598 |
};
|
|
|
bac598 |
+
|
|
|
bac598 |
+struct tevent_req *
|
|
|
bac598 |
+cache_req_user_by_upn_send(TALLOC_CTX *mem_ctx,
|
|
|
bac598 |
+ struct tevent_context *ev,
|
|
|
bac598 |
+ struct resp_ctx *rctx,
|
|
|
bac598 |
+ struct sss_nc_ctx *ncache,
|
|
|
bac598 |
+ int cache_refresh_percent,
|
|
|
bac598 |
+ enum cache_req_dom_type req_dom_type,
|
|
|
bac598 |
+ const char *domain,
|
|
|
bac598 |
+ const char *upn)
|
|
|
bac598 |
+{
|
|
|
bac598 |
+ struct cache_req_data *data;
|
|
|
bac598 |
+
|
|
|
bac598 |
+ data = cache_req_data_name(mem_ctx, CACHE_REQ_USER_BY_UPN, upn);
|
|
|
bac598 |
+ if (data == NULL) {
|
|
|
bac598 |
+ return NULL;
|
|
|
bac598 |
+ }
|
|
|
bac598 |
+
|
|
|
bac598 |
+ return cache_req_steal_data_and_send(mem_ctx, ev, rctx, ncache,
|
|
|
bac598 |
+ cache_refresh_percent,
|
|
|
bac598 |
+ req_dom_type, domain,
|
|
|
bac598 |
+ data);
|
|
|
bac598 |
+}
|
|
|
bac598 |
--
|
|
|
bac598 |
2.21.3
|
|
|
bac598 |
|