summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/clidgram.c8
-rw-r--r--source3/winbindd/winbindd_cm.c11
2 files changed, 10 insertions, 9 deletions
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c
index fed5fc0a14..83e50e553d 100644
--- a/source3/libsmb/clidgram.c
+++ b/source3/libsmb/clidgram.c
@@ -126,7 +126,8 @@ static const char *mailslot_name(TALLOC_CTX *mem_ctx, struct in_addr dc_ip)
NBT_MAILSLOT_GETDC, dc_ip.s_addr);
}
-bool send_getdc_request(struct messaging_context *msg_ctx,
+bool send_getdc_request(TALLOC_CTX *mem_ctx,
+ struct messaging_context *msg_ctx,
struct sockaddr_storage *dc_ss,
const char *domain_name,
const DOM_SID *sid)
@@ -139,7 +140,6 @@ bool send_getdc_request(struct messaging_context *msg_ctx,
enum ndr_err_code ndr_err;
DATA_BLOB blob;
struct dom_sid my_sid;
- TALLOC_CTX *mem_ctx = talloc_tos();
ZERO_STRUCT(packet);
ZERO_STRUCT(my_sid);
@@ -193,14 +193,14 @@ bool send_getdc_request(struct messaging_context *msg_ctx,
dc_ss);
}
-bool receive_getdc_response(struct sockaddr_storage *dc_ss,
+bool receive_getdc_response(TALLOC_CTX *mem_ctx,
+ struct sockaddr_storage *dc_ss,
const char *domain_name,
const char **dc_name)
{
struct packet_struct *packet;
const char *my_mailslot = NULL;
struct in_addr dc_ip;
- TALLOC_CTX *mem_ctx = talloc_tos();
DATA_BLOB blob;
struct nbt_ntlogon_packet r;
union dgram_message_body p;
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 97b2259985..5cff052114 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1024,7 +1024,8 @@ static bool add_sockaddr_to_array(TALLOC_CTX *mem_ctx,
convert an ip to a name
*******************************************************************/
-static bool dcip_to_name(const struct winbindd_domain *domain,
+static bool dcip_to_name(TALLOC_CTX *mem_ctx,
+ const struct winbindd_domain *domain,
struct sockaddr_storage *pss,
fstring name )
{
@@ -1091,13 +1092,13 @@ static bool dcip_to_name(const struct winbindd_domain *domain,
/* try GETDC requests next */
- if (send_getdc_request(winbind_messaging_context(),
+ if (send_getdc_request(mem_ctx, winbind_messaging_context(),
pss, domain->name, &domain->sid)) {
const char *dc_name = NULL;
int i;
smb_msleep(100);
for (i=0; i<5; i++) {
- if (receive_getdc_response(pss, domain->name, &dc_name)) {
+ if (receive_getdc_response(mem_ctx, pss, domain->name, &dc_name)) {
fstrcpy(name, dc_name);
namecache_store(name, 0x20, 1, &ip_list);
return True;
@@ -1291,7 +1292,7 @@ static bool find_new_dc(TALLOC_CTX *mem_ctx,
}
/* Try to figure out the name */
- if (dcip_to_name(domain, pss, dcname)) {
+ if (dcip_to_name(mem_ctx, domain, pss, dcname)) {
return True;
}
@@ -1336,7 +1337,7 @@ static NTSTATUS cm_open_connection(struct winbindd_domain *domain,
AI_NUMERICHOST)) {
return NT_STATUS_UNSUCCESSFUL;
}
- if (dcip_to_name( domain, &ss, saf_name )) {
+ if (dcip_to_name(mem_ctx, domain, &ss, saf_name )) {
fstrcpy( domain->dcname, saf_name );
} else {
winbind_add_failed_connection_entry(