diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-07-24 20:11:25 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-07-25 00:10:47 +0200 |
commit | 79ccb96cd35baffc848cd96b20553aa958dd69b0 (patch) | |
tree | 5b9bce4d1093dde75a900f4333fc8d027b38d89d /source3/torture | |
parent | 20d43a1d302ea4d890adaca9cee80ca0549eddc8 (diff) | |
download | samba-79ccb96cd35baffc848cd96b20553aa958dd69b0.tar.gz samba-79ccb96cd35baffc848cd96b20553aa958dd69b0.tar.bz2 samba-79ccb96cd35baffc848cd96b20553aa958dd69b0.zip |
s3:torture/test_smb2: make a copy of smbXcli_tcon
metze
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jul 25 00:10:47 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/test_smb2.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c index 6892ad0a23..657883bb43 100644 --- a/source3/torture/test_smb2.c +++ b/source3/torture/test_smb2.c @@ -41,6 +41,7 @@ bool run_smb2_basic(int dummy) uint8_t *dir_data; uint32_t dir_data_length; uint32_t saved_tid = 0; + struct smbXcli_tcon *saved_tcon = NULL; uint64_t saved_uid = 0; printf("Starting SMB2-BASIC\n"); @@ -169,11 +170,21 @@ bool run_smb2_basic(int dummy) } saved_tid = cli->smb2.tid; + saved_tcon = cli->smb2.tcon; + cli->smb2.tcon = smbXcli_tcon_create(cli); + smb2cli_tcon_set_values(cli->smb2.tcon, + saved_tid, + 0, /* type */ + 0, /* flags */ + 0, /* capabilities */ + 0 /* maximal_access */); status = smb2cli_tdis(cli); if (!NT_STATUS_IS_OK(status)) { printf("smb2cli_tdis returned %s\n", nt_errstr(status)); return false; } + talloc_free(cli->smb2.tcon); + cli->smb2.tcon = saved_tcon; cli->smb2.tid = saved_tid; status = smb2cli_tdis(cli); @@ -1444,6 +1455,7 @@ bool run_smb2_session_reauth(int dummy) struct auth_generic_state *auth_generic_state; struct iovec *recv_iov; uint32_t saved_tid; + struct smbXcli_tcon *saved_tcon; printf("Starting SMB2-SESSION_REAUTH\n"); @@ -1719,11 +1731,21 @@ bool run_smb2_session_reauth(int dummy) } saved_tid = cli->smb2.tid; + saved_tcon = cli->smb2.tcon; + cli->smb2.tcon = smbXcli_tcon_create(cli); + smb2cli_tcon_set_values(cli->smb2.tcon, + saved_tid, + 0, /* type */ + 0, /* flags */ + 0, /* capabilities */ + 0 /* maximal_access */); status = cli_tree_connect(cli, share, "?????", "", 0); if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) { printf("cli_tree_connect returned %s\n", nt_errstr(status)); return false; } + talloc_free(cli->smb2.tcon); + cli->smb2.tcon = saved_tcon; cli->smb2.tid = saved_tid; subreq = smb2cli_session_setup_send(talloc_tos(), ev, @@ -1888,11 +1910,21 @@ bool run_smb2_session_reauth(int dummy) } saved_tid = cli->smb2.tid; + saved_tcon = cli->smb2.tcon; + cli->smb2.tcon = smbXcli_tcon_create(cli); + smb2cli_tcon_set_values(cli->smb2.tcon, + saved_tid, + 0, /* type */ + 0, /* flags */ + 0, /* capabilities */ + 0 /* maximal_access */); status = cli_tree_connect(cli, share, "?????", "", 0); if (!NT_STATUS_IS_OK(status)) { printf("cli_tree_connect returned %s\n", nt_errstr(status)); return false; } + talloc_free(cli->smb2.tcon); + cli->smb2.tcon = saved_tcon; cli->smb2.tid = saved_tid; return true; |