diff options
author | Samuel Cabrero <scabrero@samba.org> | 2022-05-25 13:25:32 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2022-06-27 15:50:29 +0000 |
commit | f4d0db0d404a9f20671e009e21760fd1ca0701e1 (patch) | |
tree | d67be809f2af640096653e4ef3d0b93fb8e6c06f | |
parent | 6130d1139817d0526f92c4ddfbb55c622c35084d (diff) | |
download | samba-f4d0db0d404a9f20671e009e21760fd1ca0701e1.tar.gz |
s3:winbind: Pass a memory context to ads_idmap_cached_connection()
Prepare to allocate ADS_STRUCT under a talloc context.
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/winbindd/idmap_ad_nss.c | 2 | ||||
-rw-r--r-- | source3/winbindd/idmap_rfc2307.c | 2 | ||||
-rw-r--r-- | source3/winbindd/winbindd_ads.c | 4 | ||||
-rw-r--r-- | source3/winbindd/winbindd_ads.h | 5 |
4 files changed, 8 insertions, 5 deletions
diff --git a/source3/winbindd/idmap_ad_nss.c b/source3/winbindd/idmap_ad_nss.c index 8cc3bafb570..31202806214 100644 --- a/source3/winbindd/idmap_ad_nss.c +++ b/source3/winbindd/idmap_ad_nss.c @@ -65,7 +65,7 @@ static ADS_STATUS ad_idmap_cached_connection(struct idmap_domain *dom) ctx = talloc_get_type(dom->private_data, struct idmap_ad_context); - status = ads_idmap_cached_connection(&ctx->ads, dom->name); + status = ads_idmap_cached_connection(dom->name, ctx, &ctx->ads); if (!ADS_ERR_OK(status)) { return status; } diff --git a/source3/winbindd/idmap_rfc2307.c b/source3/winbindd/idmap_rfc2307.c index 4870ca30485..6d9eeee7527 100644 --- a/source3/winbindd/idmap_rfc2307.c +++ b/source3/winbindd/idmap_rfc2307.c @@ -80,7 +80,7 @@ static NTSTATUS idmap_rfc2307_ads_check_connection(struct idmap_domain *dom) ctx = talloc_get_type(dom->private_data, struct idmap_rfc2307_context); dom_name = ctx->ldap_domain ? ctx->ldap_domain : dom->name; - status = ads_idmap_cached_connection(&ctx->ads, dom_name); + status = ads_idmap_cached_connection(dom_name, ctx, &ctx->ads); if (ADS_ERR_OK(status)) { ctx->ldap = ctx->ads->ldap.ld; } else { diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index 2fc62d7b37c..a2311e76559 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -174,7 +174,9 @@ static ADS_STATUS ads_cached_connection_connect(ADS_STRUCT **adsp, return status; } -ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name) +ADS_STATUS ads_idmap_cached_connection(const char *dom_name, + TALLOC_CTX *mem_ctx, + ADS_STRUCT **adsp) { char *ldap_server = NULL; char *realm = NULL; diff --git a/source3/winbindd/winbindd_ads.h b/source3/winbindd/winbindd_ads.h index 5f121c89e8f..0fd97740caa 100644 --- a/source3/winbindd/winbindd_ads.h +++ b/source3/winbindd/winbindd_ads.h @@ -27,7 +27,8 @@ extern struct winbindd_methods ads_methods; -ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, - const char *dom_name); +ADS_STATUS ads_idmap_cached_connection(const char *dom_name, + TALLOC_CTX *mem_ctx, + ADS_STRUCT **adsp); #endif |