summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-04-24 21:37:42 +0200
committerGünther Deschner <gd@samba.org>2008-04-24 22:01:52 +0200
commitb77601a4b7c9d0f472eb51dad1d491d54a6dcbdc (patch)
treec02f6072120d1d661bb333ec5a9e2b7b4d2cec3d /source3/libsmb
parent012d6782111a2700ee80c79be1a1c07a41dab952 (diff)
downloadsamba-b77601a4b7c9d0f472eb51dad1d491d54a6dcbdc.tar.gz
samba-b77601a4b7c9d0f472eb51dad1d491d54a6dcbdc.tar.bz2
samba-b77601a4b7c9d0f472eb51dad1d491d54a6dcbdc.zip
mailslot: allow to give back struct nbt_ntlogon_packet.
Guenther (This used to be commit 2b178dcae608ecc05f62593a7a0c2a127b8b7ca2)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clidgram.c11
-rw-r--r--source3/libsmb/dsgetdcname.c4
2 files changed, 13 insertions, 2 deletions
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c
index ba958fa6f9..fba009d427 100644
--- a/source3/libsmb/clidgram.c
+++ b/source3/libsmb/clidgram.c
@@ -197,7 +197,8 @@ bool send_getdc_request(TALLOC_CTX *mem_ctx,
bool receive_getdc_response(TALLOC_CTX *mem_ctx,
struct sockaddr_storage *dc_ss,
const char *domain_name,
- const char **dc_name)
+ const char **dc_name,
+ struct nbt_ntlogon_packet **reply)
{
struct packet_struct *packet;
const char *my_mailslot = NULL;
@@ -299,6 +300,14 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx,
if (**dc_name == '\\') *dc_name += 1;
if (**dc_name == '\\') *dc_name += 1;
+ if (reply) {
+ *reply = talloc_memdup(mem_ctx, &r,
+ sizeof(struct nbt_ntlogon_packet));
+ if (!*reply) {
+ return false;
+ }
+ }
+
DEBUG(10, ("GetDC gave name %s for domain %s\n",
*dc_name, returned_domain));
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index f357e92b9b..af1dc04059 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -779,6 +779,7 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx,
const char *dc_name = NULL;
fstring tmp_dc_name;
struct messaging_context *msg_ctx = msg_context(mem_ctx);
+ struct nbt_ntlogon_packet *reply = NULL;
if (flags & DS_PDC_REQUIRED) {
name_type = NBT_NAME_PDC;
@@ -805,7 +806,8 @@ static NTSTATUS process_dc_netbios(TALLOC_CTX *mem_ctx,
if (receive_getdc_response(mem_ctx,
&dclist[i].ss,
domain_name,
- &dc_name)) {
+ &dc_name,
+ &reply)) {
namecache_store(dc_name, NBT_NAME_SERVER, 1, &ip_list);
dc_hostname = dc_name;
dc_domain_name = talloc_strdup_upper(mem_ctx, domain_name);