From 3e54c36fa459ec6f5e721b90ce4e4c1d0e31d85c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 11 Nov 2005 09:11:51 +0000 Subject: r11674: SMB2 tree connect now works. We do 2 session setups and 2 tree connects, giving the following output: Running SMB2-CONNECT Negprot reply: current_time = Fri Nov 11 20:10:42 2005 EST boot_time = Sat Nov 12 10:34:33 2005 EST Session setup gave UID 0x40000000071 Session setup gave UID 0x140000000075 Tree connect gave tid = 0x7500000001 Tree connect gave tid = 0x7500000005 SMB2-CONNECT took 0.049024 secs (This used to be commit a24a4c311005dec4c5638e9c7c10e5e2f9872f4d) --- source4/torture/smb2/connect.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'source4/torture/smb2') diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c index 49b9582d4d..8b5a26bce3 100644 --- a/source4/torture/smb2/connect.c +++ b/source4/torture/smb2/connect.c @@ -164,6 +164,35 @@ static struct smb2_session *torture_smb2_session(struct smb2_transport *transpor return session; } + +/* + send a tree connect +*/ +static struct smb2_tree *torture_smb2_tree(struct smb2_session *session, + const char *share) +{ + struct smb2_tree *tree; + struct smb2_tree_connect io; + NTSTATUS status; + + tree = smb2_tree_init(session, session, True); + + io.in.unknown1 = 0x09; + io.in.path = talloc_asprintf(tree, "\\\\%s\\%s", + session->transport->socket->hostname, + share); + + status = smb2_tree_connect(tree, &io); + if (!NT_STATUS_IS_OK(status)) { + printf("tcon failed - %s\n", nt_errstr(status)); + return NULL; + } + + printf("Tree connect gave tid = 0x%llx\n", io.out.tid); + + return tree; +} + /* basic testing of SMB2 connection calls */ @@ -171,12 +200,17 @@ BOOL torture_smb2_connect(void) { TALLOC_CTX *mem_ctx = talloc_new(NULL); struct smb2_transport *transport; - struct smb2_session *session; + struct smb2_session *session; + struct smb2_tree *tree; const char *host = lp_parm_string(-1, "torture", "host"); + const char *share = lp_parm_string(-1, "torture", "share"); struct cli_credentials *credentials = cmdline_credentials; transport = torture_smb2_negprot(mem_ctx, host); - session = torture_smb2_session(transport, credentials); + session = torture_smb2_session(transport, credentials); + session = torture_smb2_session(transport, credentials); + tree = torture_smb2_tree(session, share); + tree = torture_smb2_tree(session, share); talloc_free(mem_ctx); -- cgit