From: Samuel Cabrero Date: Wed, 25 May 2022 15:09:51 +0000 (+0200) Subject: s3:net: Pass a memory context to ads_startup_nobind() X-Git-Tag: tevent-0.13.0~281 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0693b9aa30bfb4a60ece7d7e6fd56032fdfc0936;p=thirdparty%2Fsamba.git s3:net: Pass a memory context to ads_startup_nobind() The ads struct will be allocated under this context. Signed-off-by: Samuel Cabrero Reviewed-by: Jeremy Allison --- diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 755f81d78b1..4f3ebeaa9ff 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -429,7 +429,7 @@ static int net_ads_lookup(struct net_context *c, int argc, const char **argv) return 0; } - status = ads_startup_nobind(c, false, &ads); + status = ads_startup_nobind(c, false, tmp_ctx, &ads); if (!ADS_ERR_OK(status)) { d_fprintf(stderr, _("Didn't find the cldap server!\n")); goto out; @@ -555,7 +555,7 @@ static int net_ads_info(struct net_context *c, int argc, const char **argv) return 0; } - status = ads_startup_nobind(c, false, &ads); + status = ads_startup_nobind(c, false, tmp_ctx, &ads); if (!ADS_ERR_OK(status)) { d_fprintf(stderr, _("Didn't find the ldap server!\n")); goto out; @@ -745,7 +745,10 @@ ADS_STATUS ads_startup(struct net_context *c, bool only_own_domain, ADS_STRUCT * return ads_startup_int(c, only_own_domain, 0, ads); } -ADS_STATUS ads_startup_nobind(struct net_context *c, bool only_own_domain, ADS_STRUCT **ads) +ADS_STATUS ads_startup_nobind(struct net_context *c, + bool only_own_domain, + TALLOC_CTX *mem_ctx, + ADS_STRUCT **ads) { return ads_startup_int(c, only_own_domain, ADS_AUTH_NO_BIND, ads); } @@ -808,7 +811,7 @@ static int net_ads_workgroup(struct net_context *c, int argc, const char **argv) return 0; } - status = ads_startup_nobind(c, false, &ads); + status = ads_startup_nobind(c, false, tmp_ctx, &ads); if (!ADS_ERR_OK(status)) { d_fprintf(stderr, _("Didn't find the cldap server!\n")); goto out; diff --git a/source3/utils/net_proto.h b/source3/utils/net_proto.h index b6ff639a094..3e4f1639bbd 100644 --- a/source3/utils/net_proto.h +++ b/source3/utils/net_proto.h @@ -34,7 +34,10 @@ enum netr_SchannelType get_sec_channel_type(const char *param); /* The following definitions come from utils/net_ads.c */ struct ads_struct; ADS_STATUS ads_startup(struct net_context *c, bool only_own_domain, struct ads_struct **ads); -ADS_STATUS ads_startup_nobind(struct net_context *c, bool only_own_domain, struct ads_struct **ads); +ADS_STATUS ads_startup_nobind(struct net_context *c, + bool only_own_domain, + TALLOC_CTX *mem_ctx, + struct ads_struct **ads); int net_ads_check_our_domain(struct net_context *c); int net_ads_check(struct net_context *c); int net_ads_user(struct net_context *c, int argc, const char **argv);