Prepare to allocate ADS_STRUCT under a talloc context.
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
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;
}
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 {
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;
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