1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

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>
This commit is contained in:
Samuel Cabrero 2022-05-25 13:25:32 +02:00 committed by Jeremy Allison
parent 6130d11398
commit f4d0db0d40
4 changed files with 8 additions and 5 deletions

View File

@ -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); 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)) { if (!ADS_ERR_OK(status)) {
return status; return status;
} }

View File

@ -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); ctx = talloc_get_type(dom->private_data, struct idmap_rfc2307_context);
dom_name = ctx->ldap_domain ? ctx->ldap_domain : dom->name; 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)) { if (ADS_ERR_OK(status)) {
ctx->ldap = ctx->ads->ldap.ld; ctx->ldap = ctx->ads->ldap.ld;
} else { } else {

View File

@ -174,7 +174,9 @@ static ADS_STATUS ads_cached_connection_connect(ADS_STRUCT **adsp,
return status; 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 *ldap_server = NULL;
char *realm = NULL; char *realm = NULL;

View File

@ -27,7 +27,8 @@
extern struct winbindd_methods ads_methods; extern struct winbindd_methods ads_methods;
ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, ADS_STATUS ads_idmap_cached_connection(const char *dom_name,
const char *dom_name); TALLOC_CTX *mem_ctx,
ADS_STRUCT **adsp);
#endif #endif