diff options
author | Günther Deschner <gd@samba.org> | 2008-04-24 21:29:48 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-04-24 22:01:51 +0200 |
commit | 012d6782111a2700ee80c79be1a1c07a41dab952 (patch) | |
tree | 020389df09e3ffff2a9acd89333bb74e0426a120 | |
parent | e66d452466514a16c15acf64cbb9494b46ea92c1 (diff) | |
download | samba-012d6782111a2700ee80c79be1a1c07a41dab952.tar.gz samba-012d6782111a2700ee80c79be1a1c07a41dab952.tar.bz2 samba-012d6782111a2700ee80c79be1a1c07a41dab952.zip |
mailslot: make sure we are looking at the correct reply structure.
Guenther
(This used to be commit c6ce07fdf57c8b63ba6d72b622be261723cb55e3)
-rw-r--r-- | source3/libsmb/clidgram.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c index 41d6916b97..ba958fa6f9 100644 --- a/source3/libsmb/clidgram.c +++ b/source3/libsmb/clidgram.c @@ -207,6 +207,9 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, union dgram_message_body p; enum ndr_err_code ndr_err; + const char *returned_dc = NULL; + const char *returned_domain = NULL; + if (dc_ss->ss_family != AF_INET) { return false; } @@ -268,13 +271,27 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, NDR_PRINT_DEBUG(nbt_ntlogon_packet, &r); } - if (!strequal(r.req.reply.domain, domain_name)) { + switch (r.command) { + case NTLOGON_SAM_LOGON_REPLY: + case NTLOGON_SAM_LOGON_REPLY15: + returned_domain = r.req.reply.domain; + returned_dc = r.req.reply.server; + break; + case NTLOGON_RESPONSE_FROM_PDC2: + returned_domain = r.req.reply2.domain; + returned_dc = r.req.reply2.pdc_name; + break; + default: + return false; + } + + if (!strequal(returned_domain, domain_name)) { DEBUG(3, ("GetDC: Expected domain %s, got %s\n", - domain_name, r.req.reply.domain)); + domain_name, returned_domain)); return false; } - *dc_name = talloc_strdup(mem_ctx, r.req.reply.server); + *dc_name = talloc_strdup(mem_ctx, returned_dc); if (!*dc_name) { return false; } @@ -283,7 +300,7 @@ bool receive_getdc_response(TALLOC_CTX *mem_ctx, if (**dc_name == '\\') *dc_name += 1; DEBUG(10, ("GetDC gave name %s for domain %s\n", - *dc_name, r.req.reply.domain)); + *dc_name, returned_domain)); return True; } |