From 6c8052a571a74ab67d371a624e561ecdc50744af Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Wed, 10 Dec 2014 15:02:15 +0100 Subject: [PATCH 157/160] IPA: add get_be_acct_req_for_user_name() Related to https://fedorahosted.org/sssd/ticket/2481 Reviewed-by: Jakub Hrozek (cherry picked from commit d32b165fad7b89462f49c82349e1df5a2343afa2) --- src/providers/ipa/ipa_id.h | 5 +++++ src/providers/ipa/ipa_views.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/providers/ipa/ipa_id.h b/src/providers/ipa/ipa_id.h index 9d219f281847df0ba4ac24061e598eb6915f9c38..2bb5e0d38f42d4bbb04854dfb04804fecf6257e8 100644 --- a/src/providers/ipa/ipa_id.h +++ b/src/providers/ipa/ipa_id.h @@ -87,6 +87,11 @@ errno_t get_be_acct_req_for_uuid(TALLOC_CTX *mem_ctx, const char *uuid, const char *domain_name, struct be_acct_req **_ar); +errno_t get_be_acct_req_for_user_name(TALLOC_CTX *mem_ctx, + const char *user_name, + const char *domain_name, + struct be_acct_req **_ar); + struct tevent_req *ipa_get_ad_override_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct sdap_id_ctx *sdap_id_ctx, diff --git a/src/providers/ipa/ipa_views.c b/src/providers/ipa/ipa_views.c index c768186d7cf5e5a997e2ca27a167b62c8dc99b3f..ccaea69563728a5cecc202709da5dab51747c040 100644 --- a/src/providers/ipa/ipa_views.c +++ b/src/providers/ipa/ipa_views.c @@ -177,6 +177,10 @@ static errno_t get_be_acct_req_for_xyz(TALLOC_CTX *mem_ctx, const char *val, ar->entry_type = BE_REQ_BY_UUID; ar->filter_type = BE_FILTER_UUID; break; + case BE_REQ_USER: + ar->entry_type = BE_REQ_USER; + ar->filter_type = BE_FILTER_NAME; + break; default: DEBUG(SSSDBG_CRIT_FAILURE, "Unsupported request type [%d].\n", type); talloc_free(ar); @@ -213,6 +217,15 @@ errno_t get_be_acct_req_for_uuid(TALLOC_CTX *mem_ctx, const char *uuid, _ar); } +errno_t get_be_acct_req_for_user_name(TALLOC_CTX *mem_ctx, + const char *user_name, + const char *domain_name, + struct be_acct_req **_ar) +{ + return get_be_acct_req_for_xyz(mem_ctx, user_name, domain_name, BE_REQ_USER, + _ar); +} + struct ipa_get_ad_override_state { struct tevent_context *ev; struct sdap_id_ctx *sdap_id_ctx; -- 2.1.0