diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-11-11 09:11:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:46:11 -0500 |
commit | 3e54c36fa459ec6f5e721b90ce4e4c1d0e31d85c (patch) | |
tree | 4b531427bf84558e179c4345d0968b08072c2814 /source4/torture | |
parent | 6c4be5073de177668d8c8fc05de625d3c9125268 (diff) | |
download | samba-3e54c36fa459ec6f5e721b90ce4e4c1d0e31d85c.tar.gz samba-3e54c36fa459ec6f5e721b90ce4e4c1d0e31d85c.tar.bz2 samba-3e54c36fa459ec6f5e721b90ce4e4c1d0e31d85c.zip |
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)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smb2/connect.c | 38 |
1 files changed, 36 insertions, 2 deletions
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); |