From: Samuel Cabrero Date: Wed, 25 May 2022 11:25:32 +0000 (+0200) Subject: s3:winbind: Pass a memory context to ads_idmap_cached_connection() X-Git-Tag: tevent-0.13.0~296 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4d0db0d404a9f20671e009e21760fd1ca0701e1;p=thirdparty%2Fsamba.git 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 Reviewed-by: Jeremy Allison --- 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