summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-05-17 13:24:29 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-05-17 13:24:29 +1000
commit4f557d7954eb80e566a91b2fe22f7b7e30e0b456 (patch)
tree6e656626a2631200c66869c7bef313f77ef37084 /source4/torture
parent842040d18490d9f6d1fed621aa36946e2becc3e1 (diff)
downloadsamba-4f557d7954eb80e566a91b2fe22f7b7e30e0b456.tar.gz
samba-4f557d7954eb80e566a91b2fe22f7b7e30e0b456.tar.bz2
samba-4f557d7954eb80e566a91b2fe22f7b7e30e0b456.zip
Show that the NTLOGON and NETLOGON mailslots are *very* similar.
Rework the mailslot infrustructure to cope, passing down the mailslot name so that we can implement both in the same callback function. Andrew Bartlett (This used to be commit 89fdd77891529aa74bb920994b8b5959aae8ac2d)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/nbt/dgram.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c
index 38cc20b3b9..ce5758977d 100644
--- a/source4/torture/nbt/dgram.c
+++ b/source4/torture/nbt/dgram.c
@@ -39,6 +39,7 @@
*/
static void netlogon_handler(struct dgram_mailslot_handler *dgmslot,
struct nbt_dgram_packet *packet,
+ const char *mailslot_name,
struct socket_address *src)
{
NTSTATUS status;
@@ -378,6 +379,30 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
event_loop_once(dgmsock->event_ctx);
}
+ ZERO_STRUCT(logon);
+ logon.command = LOGON_PRIMARY_QUERY;
+ logon.req.pdc.computer_name = TEST_NAME;
+ logon.req.pdc.mailslot_name = dgmslot->mailslot_name;
+ logon.req.pdc.unicode_name = TEST_NAME;
+ logon.req.pdc.nt_version = 1;
+ logon.req.pdc.lmnt_token = 0xFFFF;
+ logon.req.pdc.lm20_token = 0xFFFF;
+
+ make_nbt_name_client(&myname, TEST_NAME);
+
+ dest = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name,
+ address, lp_dgram_port(tctx->lp_ctx));
+ torture_assert(tctx, dest != NULL, "Error getting address");
+ status = dgram_mailslot_netlogon_send(dgmsock,
+ &name, dest,
+ NBT_MAILSLOT_NTLOGON,
+ &myname, &logon);
+ torture_assert_ntstatus_ok(tctx, status, "Failed to send ntlogon request");
+
+ while (timeval_elapsed(&tv) < 5 && replies == 0) {
+ event_loop_once(dgmsock->event_ctx);
+ }
+
torture_leave_domain(join_ctx);
return true;
}