]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbind: Pass a memory context to ads_idmap_cached_connection()
authorSamuel Cabrero <scabrero@samba.org>
Wed, 25 May 2022 11:25:32 +0000 (13:25 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 27 Jun 2022 15:50:29 +0000 (15:50 +0000)
Prepare to allocate ADS_STRUCT under a talloc context.

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/winbindd/idmap_ad_nss.c
source3/winbindd/idmap_rfc2307.c
source3/winbindd/winbindd_ads.c
source3/winbindd/winbindd_ads.h

index 8cc3bafb57024eeea0fd35654553f93490c7a47c..31202806214626b46d0c7893f99c95913a9df42f 100644 (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);
 
-       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;
        }
index 4870ca3048544d45176f409d35b48274dbc4ca21..6d9eeee752714140bfae1cdfc6058bd7d9f0c2b8 100644 (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);
        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 {
index 2fc62d7b37cb2d2cde21d48d403de18ee55e6aa9..a2311e7655979fb2291af253f4cfd16a8c5495d1 100644 (file)
@@ -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;
index 5f121c89e8f092da06611f588aa70ab7c3e89e7d..0fd97740caa85a6f1266e96b70a42b57d2c76c5e 100644 (file)
@@ -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