From 91f0382974ca7ed158ddb3da179b41c96292cc19 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek@redhat.com>
Date: Tue, 21 May 2019 12:07:59 +0200
Subject: [PATCH 34/48] BE: Pass in filter_type when creating the refresh
account request
For refreshing AD users and groups, we'll want to create a request by
SID, for all other requests we'll want to create a request by name. This
patch allows parametrizing the request creation by the caller.
Related:
https://pagure.io/SSSD/sssd/issue/4012
Reviewed-by: Sumit Bose <sbose@redhat.com>
---
src/providers/be_refresh.c | 3 ++-
src/providers/be_refresh.h | 1 +
src/providers/ldap/sdap_refresh.c | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/providers/be_refresh.c b/src/providers/be_refresh.c
index c49229e71..c4ff71e1f 100644
--- a/src/providers/be_refresh.c
+++ b/src/providers/be_refresh.c
@@ -365,6 +365,7 @@ errno_t be_refresh_recv(struct tevent_req *req)
struct dp_id_data *be_refresh_acct_req(TALLOC_CTX *mem_ctx,
uint32_t entry_type,
+ uint32_t filter_type,
struct sss_domain_info *domain)
{
struct dp_id_data *account_req;
@@ -375,7 +376,7 @@ struct dp_id_data *be_refresh_acct_req(TALLOC_CTX *mem_ctx,
}
account_req->entry_type = entry_type;
- account_req->filter_type = BE_FILTER_NAME;
+ account_req->filter_type = filter_type;
account_req->extra_value = NULL;
account_req->domain = domain->name;
return account_req;
diff --git a/src/providers/be_refresh.h b/src/providers/be_refresh.h
index b7ba5d4c2..c7b4872df 100644
--- a/src/providers/be_refresh.h
+++ b/src/providers/be_refresh.h
@@ -71,6 +71,7 @@ errno_t be_refresh_recv(struct tevent_req *req);
struct dp_id_data *be_refresh_acct_req(TALLOC_CTX *mem_ctx,
uint32_t entry_type,
+ uint32_t filter_type,
struct sss_domain_info *domain);
#endif /* _DP_REFRESH_H_ */
diff --git a/src/providers/ldap/sdap_refresh.c b/src/providers/ldap/sdap_refresh.c
index af39d8686..2206d6670 100644
--- a/src/providers/ldap/sdap_refresh.c
+++ b/src/providers/ldap/sdap_refresh.c
@@ -73,7 +73,8 @@ static struct tevent_req *sdap_refresh_send(TALLOC_CTX *mem_ctx,
goto immediately;
}
- state->account_req = be_refresh_acct_req(state, entry_type, domain);
+ state->account_req = be_refresh_acct_req(state, entry_type,
+ BE_FILTER_NAME, domain);
if (state->account_req == NULL) {
ret = ENOMEM;
goto immediately;
--
2.20.1